home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 17,553 of 19,505   
   =?windows-1252?Q?Arne_Vajh=F8j?= to All   
   Re: MS SQL Server, JDBC, and Unicode?   
   11 Jul 09 09:57:41   
   
   XPost: comp.lang.java.programmer   
   From: arne@vajhoej.dk   
      
   Arne Vajhøj wrote:   
   > Erland Sommarskog wrote:   
   >> That would be even stranger, since I would expect your ANSI code page   
   >> to be 1252, in which case things cannot go wrong.   
   >   
   > Things can always go wrong.   
   >   
   > But you think the test would be better with a unicode value > 255 ?   
      
   Just tried with:   
      
            stmt.executeUpdate("INSERT INTO unifun   
   VALUES(1,N'\u20AC\u20AC\u20AC the wrong way')");   
            PreparedStatement pstmt = con.prepareStatement("INSERT INTO   
   unifun VALUES(?,?)");   
            pstmt.setInt(1, 2);   
            pstmt.setString(2, "\u20AC\u20AC\u20AC the correct way");   
            pstmt.executeUpdate();   
            ResultSet rs = stmt.executeQuery("SELECT id,data FROM unifun");   
            while(rs.next()) {   
                System.out.println(rs.getInt(1) + " : " + rs.getString(2));   
            }   
      
   and it displays euro signs nicely.   
      
   Arne   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca