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 3 of 3 Topic 3746 of 3784
Post > Topic >>

Re: java resultset

by Lew <lew@[EMAIL PROTECTED] > May 11, 2008 at 11:03 PM

Dave Miller wrote:
> 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

The newer RowSet interface lets you disconnect from the database while
using 
the results, unlike normal ResultSets.

-- 
Lew
 




 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 Wed Jul 9 6:38:52 CDT 2008.