Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / May 2008

Tip: Looking for answers? Try searching our database.

java resultset

Thread view: 
a - 12 May 2008 00:28 GMT
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
Dave Miller - 12 May 2008 01:20 GMT
> Hi
>
[quoted text clipped - 3 lines]
>
> 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

Signature

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

Lew - 12 May 2008 04:03 GMT
>> Hi
>>
[quoted text clipped - 18 lines]
>
> //use your result set from here

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

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.