This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Question about datasource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Question about datasource" Watch "Question about datasource" New topic
Author

Question about datasource

Gökhan Sakalli
Greenhorn

Joined: Apr 04, 2009
Posts: 20
Hello. I want to execute an SQL query in a method.

re = preparedstatement.execute(parameters);

After i invoke this method, how is the format of the rs?


And can i populate a textbox in a JSP file with my rs?
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32635
    
215

The format of the resultset depends on the SQL query. The best way to get the JSP is to store it in a data structure and then forward to the JSP.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3749
    
  10

At its cores, and a resultset is just a list of uniform hash maps. Each hash map contains a set of records based on your projection. I'd recommend trying some JDBC tutorials to get you familiar with it. And as Jeanne pointed out, never put JDBC code inside of a JSP!


[OCA 8 Book] [Blog]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about datasource
 
It's not a secret anymore!