When we are using the Microsoft SQL Server 2000 thin driver,
we get the following error.

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Statement(s) could not be prepared.
at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown Source
)
at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sErrorToken(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.proces sReplyToken(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSExecuteRequest .processReplyToken(
Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.getRow (Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplResultSe t.positionCursor(Un
known Source)
at com.microsoft.jdbc.base.BaseResultSet.next(Unknown Source)
at DBConnection.main(DBConnection.java:56)


The Query due to which this error was occuring is given below.

SELECT CP_CD,COMPANY_NAME_J,COUNTRY_NAME_J,CP_NAME,CP_NAM E_J, (CASE RESIDENT WHEN 'Y' THEN '‹Z' WHEN 'N' THEN '”ñ‹Z' END ), (CASE BANK WHEN 'Y' THEN '‹âsi‹à—Z‹@ŠÖj' WHEN 'N' THEN '‚»‚Ì‘¼' END ), (CASE RISK_BCD WHEN '1' THEN '‹âs' WHEN '2' THEN 'ØŒ”' WHEN '3' THEN '¶•ÛE‘¹•Û' WHEN '4' THEN 'Ž–‹Æ–@l' WHEN '5' THEN 'ŠO‘_•{' WHEN '0' THEN '‚»‚Ì‘¼' END ), (CASE RISK_ACD WHEN '1' THEN '’†‰›_•{‚¨‚æ‚Ñ’†‰›‹âs' WHEN '2' THEN 'Ž©s—a‹à“™’S•Û' WHEN '3' THEN '‘Â’S•Û' WHEN '4' THEN '‘ÛŠJ”_‹âs' WHEN '5' THEN '–¢Žg—p' WHEN '6' THEN '–{–MŒö‹¤•”–å' WHEN '7' THEN '–{–M‹âs‹y‚Ñ–{–MØŒ”‰ïŽÐ'WHEN '8' THEN 'OECD”‘‹âs‹y‚ÑOECD”‘ØŒ”‰ïŽÐA‚Ü‚½‚Í‚»‚Ì‘¼‚Ì‹ âs‚Ì’ZŠúÂ–±' WHEN '9' THEN 'OECD”‘‹âsˆÈŠO‚Ì‹âs‚Ì’·ŠúÂ–±' WHEN '11' THEN '’n•ûŒö‹¤’c‘Ì' WHEN '10' THEN '‚»‚Ì‘¼' END ) , (CASE RISK_CLASS WHEN '1' THEN '–{–M' WHEN '2' THEN 'OECD”‘' WHEN '0' THEN '‚»‚Ì‘¼' END ), (CASE SUBSIDIARY WHEN '1' THEN 'Œ»’n–@l' WHEN '2' THEN 'ŠCŠO“X' WHEN '0' THEN '‚»‚Ì‘¼' END )FROM CP LEFT OUTER JOIN COUNTRY ON CP.COUNTRY_CD = COUNTRY.COUNTRY_CD LEFT OUTER JOIN COMPANY ON CP.COMPANY_CD = COMPANY.COMPANY_CD ORDER BY CP_CD ASC

Note :
====

The Same Query when run in SQL Server 2000 Query Analyser is working fine and also in ORACLE 9i.

Please tell us where is the problem ?