RE: JBDC Connection and £ signs

From: Carb Simien [MSFT] (CarbinoS_at_online.microsoft.com)
Date: 08/31/04


Date: Tue, 31 Aug 2004 22:32:49 GMT


--------------------
| Thread-Topic: =?Utf-8?Q?JBDC_Connection_and_=C2=A3_signs?=
| thread-index: AcSPV4Hn/oY/gRXFReK29a4dRZPyOQ==
| X-WBNR-Posting-Host: 81.99.187.42
| From: "=?Utf-8?B?U3RlcGhlbiBSb3Rod2VsbA==?=" <Stephen
Rothwell@discussions.microsoft.com>
| Subject: =?Utf-8?Q?JBDC_Connection_and_=C2=A3_signs?=
| Date: Tue, 31 Aug 2004 05:39:07 -0700
| Lines: 15
| Message-ID: <ABD9F2F7-3E63-4132-B3FA-504FEC8733AA@microsoft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 8bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.sqlserver.jdbcdriver
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.jdbcdriver:6283
| X-Tomcat-NG: microsoft.public.sqlserver.jdbcdriver
|
| Hi,
|
| When I perform a select the £ sign appears as a ? sign. I am assuming
this
| to be due to a character set problem/configuration I have missed.
|
| Obviously the £ sign is outside the US-ASCII 7bit set so I think the
problem
| lies here.
|
| I am selecting from a VARCHAR column.
|
| Any ideas greatfully received.
|
| Many thanks
|
| Steve
|

I don't see how this is happening. If you simply create a table in the
following way, reading the data back out via Query Analyzer or JDBC works
just fine for me in a console app:

  create table foo(col1 varchar(25))
  insert foo values ('£')

        Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver" );
        Connection connection =
DriverManager.getConnection("jdbc:microsoft:sqlserver://zip:1433;databasenam
e=jdbc", "sa", "password");

        Statement stmt = connection.createStatement();
        ResultSet rs = null;
        rs = stmt.executeQuery("select col1 from foo");
        while (rs.next())
        {
                System.out.println(rs.getString(1));
        }
        rs.close();
        stmt.close();
        connection.close();

My SQL Server uses the default collation.

How was your data stored in SQL Server?
How are you retrieving the data (console app, web page)?
Can you retrieve the correct results using Query Analyzer?
What collation is used in the table schema definition?

Carb Simien, MCSE MCDBA MCAD
Microsoft Developer Support - Web Data

Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.



Relevant Pages

  • RE: Web Forms Auth fails when rfValidator triggered
    ... © 2002 Microsoft Corporation. ... | Content-Type: text/plain ... | | basically has a username field, ... | | If I enter garbage text in BOTH fields, the authentication ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Getting JBC to work
    ... Microsoft Developer Support ... | Content-Type: text/plain; ... | seem to be mentioned anywhere on MS JBC pages), ...
    (microsoft.public.dotnet.vjsharp)
  • RE: Q328310
    ... This issue may be caused by some incorrect registry keys. ... | Content-Type: text/plain; ... Produced By Microsoft MimeOLE V5.50.4910.0300 ... |>I suggest you download the update and install it locally. ...
    (microsoft.public.windowsxp.security_admin)
  • RE: Preventing driver from creating nuisance temp files
    ... | Content-Type: text/plain ... | Organization: Microsoft Corporation ... | Subject: RE: Preventing driver from creating nuisance temp files ...
    (microsoft.public.sqlserver.jdbcdriver)
  • RE: Determine if a file exist
    ... | Sender: "Tony" ... | Content-Type: text/plain; ... Produced By Microsoft MimeOLE V5.50.4910.0300 ... |>Using Windows API would be the more efficient method. ...
    (microsoft.public.access.externaldata)

Loading