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


Groups > comp.lang.java.databases > #87 > unrolled thread

java resultset

Started by"a" <a@THRWHITE.remove-dii-this>
First post2011-04-27 15:21 +0000
Last post2011-04-27 15:21 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.lang.java.databases


Contents

  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

#87 — java resultset

From"a" <a@THRWHITE.remove-dii-this>
Date2011-04-27 15:21 +0000
Subjectjava resultset
Message-ID<CiLVj.133659$Cj7.89447@pd7urf2no>
  To: comp.lang.java.databases
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

---
 * 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

[toc] | [next] | [standalone]


#88

From"Dave Miller" <dave.miller@THRWHITE.remove-dii-this>
Date2011-04-27 15:21 +0000
Message-ID<H3MVj.276$i51.180@trndny09>
In reply to#87
  To: comp.lang.java.databases
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/

---
 * 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

[toc] | [prev] | [next] | [standalone]


#89

From"Lew" <lew@THRWHITE.remove-dii-this>
Date2011-04-27 15:21 +0000
Message-ID<xKGdne2gk9rrLrrVnZ2dnUVZ_gWdnZ2d@comcast.com>
In reply to#88
  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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.databases


csiph-web