This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!

Brian Barrick

Ranch Hand
+ Follow
since Mar 27, 2015
Brian likes ...
Android Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
4
Received in last 30 days
0
Total given
7
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Brian Barrick

It will be later this evening before I'm working on it again but I realized this morning that it's returning 0 so I'm going to take another look at the stored proc tonight and see what happens if I force the result to = 1. Thanks for all of your help.
With that code I'm not getting an exception but I'm still not getting a result back from the stored proc.

Is this the correct way to test the sp?

call check_Login('test','test',@result);
select @result;
I'm getting somewhere I guess. Created new stored proc - which isn't much different than the previous one.



Modified java:

Stumbled across another forum post and noticed this in the code:



Tried adding that but no dice. I'm thinking the Java is correct but there is something wrong with the stored proc? Going back to the drawing board there again...

Paul Clapham wrote:This line of code looks wrong to me:



The "getInt()" method is supposed to take the SQL parameter index as its parameter, so I'd expect to see a constant there, probably 3.

You didn't say whether you were getting an SQLException thrown -- did you get one? That's what I would expect if my guess was right. Otherwise, it would help to know what the evidence was for you thinking there was a problem.



Sorry about that, I was playing around with that after reading something about it could be an index or variable name.

No difference with

I'm getting "SQLException: No output parameters returned by procedure." in Netbeans. Trying to manually call it in MySQL Workbench doesn't give me anything either.

Thank you for your help.
I work with stored procedures on a daily basis in MS SQL and Visual Basic - so I've stubbornly been working at this till I'm blue in the face. I have a stored proc that I feel like I've written and rewritten a hundred times and simplified it as much as possible and I'm trying to call it from java with varying results except the ones I expected.

I have a very basic user table and this is my stored proc:


Am I mistaken that this should return result to my java program with the value of 1? I've tried it with @, without @ etc, et al.

Running call checkLogin(@'test',@'test',@result); and all I get is a response that 1 row was affected.

Java:



I appreciate any help possible - I thought I was pretty good at this stuff till this came along. Apparently I messed up in the beginning by thinking it would be simple. What am I overlooking/missing?

Got it working - thank you for your help. I had a line in one of the controllers that was messing things up for me.
1 year ago
So, maybe I've found something during my attempt to troubleshoot this problem.



This is printing out Empty to the console. Shouldn't it be printing the value of txtAddPartName?
1 year ago
I'm also going back to my textbook and reading the section on the StringBuilder class again as well.
1 year ago

John Damien Smith wrote:When you use a PropertyValue factory like this:

your corresponding java bean data class needs to follow Java camel case naming conventions for methods.

To see these conventions read:
Java naming conventions on Wikipedia.

For a more in depth explanation read:
https://stackoverflow.com/questions/18971109/javafx-tableview-not-showing-data-in-all-columns



Thank you - I actually just learned that earlier and modified the methods after I made this post.




Ok  - so I'd tried something similar before. (I've been trying to find any and every example I could to try and figure this out).

That being said - I set this exactly the way you specified. However, I'm still getting a blank row for the part name.


Note that, when setting the property you don't create a new property in the setter, you just create a new property once when the bean is initialized (all properties can generally be declared final even though the value inside them changes, because the property holding the value never changes).



That was something I'd picked up following a Youtube tutorial on tableviews and scenebuilder by Jaret Wright.

Also, read the PropertyValueFactory documentation which outlines all of the rules which I explained above:
https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/cell/PropertyValueFactory.html



I'll be reading through this again to get a better understanding of this. Do you have any other suggestions on what to look for since I'm still getting a blank part name? Could it be the constructor for my part class? Note - the partName portion has changed multiple times as well through this process.



1 year ago
Removed all attempts to convert it from String to SimpleStringProperty and going strictly with SimpleStringProperty as I get the partName from the textbox with this code:



And I'm back to getting it to display StringProperty [value:] in my tableview.
1 year ago
Hi all, a little nudge in the right direction here would be very much appreciated. I think I know the problem - I feel like I've tried every combination under the sun but something is missing here. I'm trying to populate a TableView called tblMainParts and everything is working except for my StringValueProperty field which is the partName field. I believe it has to do with the way my CellValueFactory calls the getters/setters so hopefully I can keep this short and sweet and see if I can't get this working without too much help.

Here is my cellvaluefactory code:



Here is my getter/setter in my part class(note, this is just what I have now, I've tried numerous combinations hoping something would work but apparently I don't quite understand it):



At one point I was actually getting sort of a Null SimpleValueProperty displaying in the tableview and now I'm not getting anything.  


1 year ago

Knute Snortum wrote:This code injects an object reference tblMainParts into the code, so no, you don't have to (and you should not) create the object with new.  The fx:id in SceneBuilder connects the FXML widget with the code's variable identifier.  Make sense?



It does, thank you. I was having some issues getting my table to populate - and thought maybe I was misunderstanding something there. So it turns out I needed to create another controller as the main.java file isn't a good file to use as a controller if it's your main entry point. So I created a separate controller - data still isn't populating the way I need it to but it eliminated some of the issues I was having.
1 year ago
I mean I do have columns in the table as well. Just trying to clarify my understanding of how scenebuilder and javafx work together.

1 year ago
When using scenebuilder with objects like tableview and columns do you still need to create those objects with the new keyword in the code or is that done already?

For instance at the top of my program before the start method I have



Then in my start method I can just start working directly with that table like this..?



1 year ago