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 / General / June 2007

Tip: Looking for answers? Try searching our database.

How to copy the result from a Select into a DataSet ?

Thread view: 
Pierre - 24 Jun 2007 17:32 GMT
Hi,

How to copy the result from a Select into a DataSet ?

Thanks,

Tintin92
bencoe@gmail.com - 24 Jun 2007 17:55 GMT
> Hi,
>
[quoted text clipped - 3 lines]
>
> Tintin92

An SQL select statement? SELECT x FROM x WHERE X AND Y?

Ben.
Lew - 29 Jun 2007 05:59 GMT
"Pierre" wrote:
>> How to copy the result from a Select into a DataSet ?

> An SQL select statement? SELECT x FROM x WHERE X AND Y?

Assuming SQL via JDBC:

<http://java.sun.com/javase/6/docs/api/java/sql/ResultSet.html>
obtained from, say, a
<http://java.sun.com/javase/6/docs/api/java/sql/PreparedStatement.html>

 PreparedStatement pstmt = con.prepareStatement(
   "SELECT name, salary WHERE id = ?" );
 ps.setString( 1, "1719232931" );
 ResultSet rs = ps.executeQuery();
 String name = rs.getString( "name" );
 BigDecimal salary = getBigDecimal( "salary" );

Assuming anything other than what we've guessed, you'll have to be a lot more
specific.  What kind of "Select"?  What is a "DataSet"?

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



©2009 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.