Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.databases > #89

Re: java resultset

From "Lew" <lew@THRWHITE.remove-dii-this>
Subject Re: java resultset
Message-ID <xKGdne2gk9rrLrrVnZ2dnUVZ_gWdnZ2d@comcast.com> (permalink)
Newsgroups comp.lang.java.databases
References <H3MVj.276$i51.180@trndny09>
Date 2011-04-27 15:21 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.databases
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

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.databases | Previous | NextPrevious in thread | Find similar


Thread

java resultset "a" <a@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
  Re: java resultset "Dave Miller" <dave.miller@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
    Re: java resultset "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000

csiph-web