ebfe17dd   
   XPost: comp.lang.java.programmer   
   From: twic@urchin.earth.li   
      
    This message is in MIME format. The first part should be readable text,   
    while the remaining parts are likely unreadable without MIME-aware tools.   
      
   On Fri, 10 Jul 2009, joe.no_junk@gmail.com wrote:   
      
   > On Jul 10, 3:36 am, Tom Anderson wrote:   
   >   
   >> Has anyone made SQL Server work with unicode in java?   
   >>   
   >> I'm working on a system which wants to put unicode in a database. It does   
   >> this fine with Oracle, but we haven't been able to make it do so when the   
   >> database is SQL Server - and indeed the manufacturers of the system list   
   >> this as something that it won't do. Anything that isn't on the current   
   >> code page turns into a question mark.   
   >>   
   >> Our columns are nvarchar, and sendStringParametersAsUnicode is true in the   
   >> JDBC URL. Is there more than this we need to do?   
   >>   
   >> I've come across mention of a syntax which looks like N'this is a unicode   
   >> string' for writing unicode literals in SQL. Do i need to do that? How do   
   >> i do that if i'm using PreparedStatements?   
   >>   
   >> We're using the MS driver. An alternative would be the open source jTDS -   
   >> any idea if that will fix the problem?   
   >   
   > Which driver are you using now?   
      
   One from Microsoft, downloaded a couple of weeks ago. I don't have access   
   to the machines with the driver on right now, so i can't be more specific,   
   i'm afraid.   
      
   > By default, the driver will send string data (parameter values) to the   
   > DBMS as 16-bit characters, as you'd want. Are you saying that you have   
   > good strings in your Java client, but on insert, the DBMS has it wrong?   
      
   That.   
      
   > Or are you saying that the DBMS can have good data, but on extracting,   
   > it's bad, or that insert+extract gets bad stuff? Show the JDBC code.   
      
   I can't - i didn't write it, and don't have the source. This is the crux   
   of the problem - i don't know if the problem is in SQL Server and/or its   
   drivers, or the way the web app is using it. But if it's doing it wrong,   
   why does it work with Oracle? It's a mystery!   
      
   tom   
      
   --   
   SOY! SOY! SOY! Soy makes you strong! Strength crushes enemies! SOY!   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|