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

Home -> Community -> Usenet -> c.d.o.server -> Oracle 10g Express jdbc thin driver setString() problem

Oracle 10g Express jdbc thin driver setString() problem

From: Srini <srini.venigalla_at_gmail.com>
Date: Tue, 10 Jul 2007 17:39:09 -0700
Message-ID: <1184114349.860954.62400@r34g2000hsd.googlegroups.com>


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

Original text of this message

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