Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> JDBC doesn't recognize records from SQLPLUS

JDBC doesn't recognize records from SQLPLUS

From: Peter Chatterton <peter_at_chatterton.name>
Date: Fri, 7 Feb 2003 21:30:37 -0500
Message-ID: <VYZ0a.5519$Pg6.1169387@news20.bellglobal.com>


JDBC doesn't recognize records from SQLPLUS I'm using 9iAS under win2000.
The JDBC is run in a servlet with java 1.2 under Textpad 4.5.0 32 bit.

In sql*plus:

    CREATE TABLE testtable1( field1 VARCHAR2(200) );     INSERT into testtable1 VALUES ('rec1-sql');     INSERT into testtable1 VALUES ('rec2-sql');

In the servlet/jdbc:

    " INSERT INTO testtable1 VALUES( 'rec3 from jdbc' ) "

From sql*plus:

    SQL> SELECT * from testtable1;
    FIELD1



    rec1-sql
    rec2-sql
    rec3 from jdbc

In the servlet/jdbc:

    PreparedStatement ps = conn.prepareStatement( "SELECT * FROM testtable1" );

    ResultSet rs = ps.executeQuery();
    while( rs.next() )

        {
        PrintWriter out.println( rs.getString( 1 ) );
        }

The PrintWriter output is:
        "rec3 from jdbc "

Hope you can help,
and thanks,
Peter. Received on Fri Feb 07 2003 - 20:30:37 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US