aspose file tools*
The moose likes JDBC and the fly likes Putting SQL results into a java variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Putting SQL results into a java variable" Watch "Putting SQL results into a java variable" New topic
Author

Putting SQL results into a java variable

Heather Mink
Greenhorn

Joined: Oct 10, 2004
Posts: 2
I have exhausted every resource at my disposal and have yet to find an answer to my problem. I am creating a simple applet for a small library in my community. It interfaces with an MS Access database. I have figured out how to query the database in jave, but I can't figure out how to take that information and put it into variable that I can use for comparison purposes. Basically, I am doing a Select (count) statement and I need to work with the count value to determine the proper course of action that the applet should take. Please help.

Thanks in advance,

Heather
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Hi Heather,

I assumed that you are doing something like this for querying stuff.



you just have to get the results from "rs", ResultSet. you can do like,



It would probably work in your case. for more please read the docs.
Heather Mink
Greenhorn

Joined: Oct 10, 2004
Posts: 2
Thank you very much. I had the result set, I was just stuck at that point. You were right on the money. I appreciate it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Putting SQL results into a java variable