Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> JDBC doesn't recognize records from SQLPLUS
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
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