Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Oracle 10g Express jdbc thin driver setString() problem
Hi
I installed Oracle 10g Express and created a simple table and added data.
LOGIN{
LOGIN_ID Char (10)
PASSWORD Char (10)
}
I am connecting to the database through Oracle thin jdbc driver.
In Java, I create a PreparedStatement (not OraclePreparedStatement) like this:
PreparedStatement ps = con.preparestatement ("Select PASSWORD from Login where LOGIN_ID=?");
When I bind the param like this:
ps.setString (1,"DEMO");
ResultSet rs = ps.executeQuery();
The query return 0 rows.
If I use the parameter directly in the query like this, it works: PreparedStatement ps = con.preparestatement ("Select PASSWORD from Login where LOGIN_ID='DEMO'");
The database NLS Character Set is showing UNICODE, not Default. I am suspecting this is the problem. Is there any way to make the parameter binding work?
I do not care for Unicode. Is there anyway to change the charset to DEFAULT, assuming parameter binding would work on DEFAULT?
Any help is appreciated. I am using the latest jdbc thin driver. Received on Tue Jul 10 2007 - 19:39:09 CDT
![]() |
![]() |