🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #143

jdbc:odbc & unicode

#143
From: jan himilsbach
Date: Thu, 05 Jun 2003 11:48
40 lines
2610 bytes
OK I've a database (mdb) which contains unicode symbols... exacly islandish
letters (ie \u00f0 \u00d0 \u00de \u00fe \u00c6 \u00e6), but.... yeah, but I
have problem... when I exucute SQL query i get '?' insteed right symbols.
Nothing change if I copy/pase symbols direct to database's fields or yse
\u.... coding way... anyone can help me???? thx for help ;)

and here is my simple code:

import java.sql.*;

public class SQLTest {
    public static void main(String[] args) {
        try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            Connection conn =
DriverManager.getConnection("jdbc:odbc:talk","", "");
            Statement st = conn.createStatement();
            ResultSet rec = st.executeQuery("SELECT word FROM test");
            System.out.println("word");
            while (rec.next()) {
                System.out.println(rec.getString(1));
            }
        st.close();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
            System.err.println("Caught Exception: " + e.getMessage());
        } catch (SQLException e) {
            e.printStackTrace();
            System.err.println("Caught Exception: " + e.getMessage());
        }
    }
}






-- 
Serwis Usenet w portalu Gazeta.pl -> http://www.gazeta.pl/usenet/
Technical Details
Message-ID: <bbnaoq$fbn$1@inews.gazeta.pl>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-stoc.telia.net!news-stoa.telia.net!telia.net!newsfeed.tpinternet.pl!news.gazeta.pl!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d6db,cc47bf3d337edd81,start
X-Google-Attributes: gid10d6db,public
X-Google-Thread: 107d46,cc47bf3d337edd81,start
X-Google-Attributes: gid107d46,public
X-Google-Thread: fb99b,cc47bf3d337edd81,start
X-Google-Attributes: gidfb99b,public
X-Google-ArrivalTime: 2003-06-05 04:49:52 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-stoc.telia.net!news-stoa.telia.net!telia.net!newsfeed.tpinternet.pl!news.gazeta.pl!not-for-mail
From: "jan himilsbach" <jan.himilsbach@interia.pl>
Newsgroups: aus.computers.java,comp.lang.java.databases,cz.comp.lang.java
Subject: jdbc:odbc & unicode
Date: Thu, 5 Jun 2003 13:48:59 +0200
Organization: Portal Gazeta.pl -> http://www.gazeta.pl
Lines: 40
Message-ID: <bbnaoq$fbn$1@inews.gazeta.pl>
NNTP-Posting-Host: labk1.ime.pw.edu.pl
X-Trace: inews.gazeta.pl 1054813786 15735 194.29.149.51 (5 Jun 2003 11:49:46 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Thu, 5 Jun 2003 11:49:46 +0000 (UTC)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-User: emc
X-MSMail-Priority: Normal