Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

prepared statement

843854Aug 29 2003 — edited Apr 1 2008
Hi,
I am using prepared statements for querying the data base for my application, I use SQLServer and JSQLCONNECT driver.
I started SQLServer's profiler and while my application is running I could see all the queries that are going to DB in the Profiler .
Here is the interesting thing,If you see the below query an N is prefixed in the where clause(If the column in where clause is VARCHAR).
SELECT * FROM ZipInfo WHERE (ZipCd = '11364') is shown as
SELECT * FROM ZipInfo WHERE (ZipCd = N'11364') in SQL Profiler.
This query I gave as a sample one, the actual tables have thousands of records.
This is causing a big performance issue, when I see the execution plan in SQLSerer with out N is much faster than with N.
Strangely I am not appending it through my code.
Could some one plz help me why this is happening.............

thanks in advance....plz send your suggestions to rramachandruni@lendingspace.com
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2008
Added on Aug 29 2003
9 comments
181 views