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

Discussion in 'Java' started by Pierre, Jun 24, 2007.

  1. Pierre

    Pierre Guest

    Hi,

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

    Thanks,

    Tintin92
     
    Pierre, Jun 24, 2007
    #1
    1. Advertisements

  2. Pierre

    Guest

    On Jun 24, 12:32 pm, "Pierre" <> wrote:
    > Hi,
    >
    > How to copy the result from a Select into a DataSet ?
    >
    > Thanks,
    >
    > Tintin92


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


    Ben.
     
    , Jun 24, 2007
    #2
    1. Advertisements

  3. Pierre

    Lew Guest

    "Pierre" wrote:
    >> How to copy the result from a Select into a DataSet ?


    wrote:
    > 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"?

    --
    Lew
     
    Lew, Jun 29, 2007
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nedu N
    Replies:
    1
    Views:
    2,049
    Chris Taylor
    Oct 31, 2003
  2. Nedu N
    Replies:
    2
    Views:
    2,496
  3. =?Utf-8?B?ZWNvZGVy?=

    Copy checkbox selected datagrid items into new dataset

    =?Utf-8?B?ZWNvZGVy?=, Oct 10, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,436
    =?Utf-8?B?ZWNvZGVy?=
    Oct 14, 2005
  4. Alex
    Replies:
    2
    Views:
    1,634
  5. Replies:
    26
    Views:
    2,609
    Roland Pibinger
    Sep 1, 2006
  6. Nedu N
    Replies:
    2
    Views:
    428
    Jacob Yang [MSFT]
    Oct 31, 2003
  7. Michael Tan
    Replies:
    32
    Views:
    1,621
    Ara.T.Howard
    Jul 21, 2005
  8. palmiere
    Replies:
    1
    Views:
    697
    Erwin Moller
    Feb 9, 2004
Loading...