This week's giveaways are in the JDBC and Relational Databases and A Day in Code forums.
We're giving away four copies each of JDBC Workbook and A Day in Code and have the authors on-line!
See this thread and this one for details.
Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Question about datasource

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
author & internet detective
Posts: 39986
806
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author
Posts: 4173
29
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
I found some pretty shells, some sea glass and this lovely tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic