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


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

Re: java resultset

From "Dave Miller" <dave.miller@THRWHITE.remove-dii-this>
Subject Re: java resultset
Message-ID <H3MVj.276$i51.180@trndny09> (permalink)
Newsgroups comp.lang.java.databases
References <CiLVj.133659$Cj7.89447@pd7urf2no>
Date 2011-04-27 15:21 +0000
Organization TDS.net

Show all headers | View raw


  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

Back to comp.lang.java.databases | Previous | NextPrevious in thread | Next 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