Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > Re: java result...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 3746 of 3800
Post > Topic >>

Re: java resultset

by Dave Miller <dave@[EMAIL PROTECTED] > May 12, 2008 at 12:20 AM

a wrote:
> Hi
> 
> Can I create a resultset that have all the specified columns? And, I
have to
> populate it with data. When the database is offline, then I can simulate
it
> to test my code. Please provide simple example.
> 
> Thanks
> 
> 
A resultset is stored in memory - I'm unsure what you mean about 
"offline". To get all of the columns, ask for all of the columns.

A simple resultset example:

java.sql.Connection c = DriverManager.getConnection("your driver and 
path to db", "your db user id", "your db password");
Statement get = c.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
                           ResultSet.CONCUR_READ_ONLY);
ResultSet rs = get.executeQuery("your query");

//use your result set from here


-- 
Dave Miller
Java Web Hosting at:
http://www.cheap-jsp-hosting.com/
 




 3 Posts in Topic:
java resultset
"a" <a@[EMAI  2008-05-11 23:28:34 
Re: java resultset
Dave Miller <dave@[EMA  2008-05-12 00:20:55 
Re: java resultset
Lew <lew@[EMAIL PROTEC  2008-05-11 23:03:18 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 23:11:41 CDT 2008.