Article View: de.comp.lang.java
Article #37jdbc:odbc & unicode
From: jan himilsbach
Date: Thu, 05 Jun 2003 11:49
Date: Thu, 05 Jun 2003 11:49
41 lines
2615 bytes
2615 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$2@inews.gazeta.pl>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!newsfeed.tpinternet.pl!newsfeed.gazeta.pl!news.gazeta.pl!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f9a23,6806f4b33a028742,start X-Google-Attributes: gidf9a23,public X-Google-Thread: 10568c,6806f4b33a028742,start X-Google-Attributes: gid10568c,public X-Google-Thread: 1116f3,6806f4b33a028742,start X-Google-Attributes: gid1116f3,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!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!newsfeed.tpinternet.pl!newsfeed.gazeta.pl!news.gazeta.pl!not-for-mail From: "jan himilsbach" <jan.himilsbach@interia.pl> Newsgroups: de.comp.lang.java,dk.edb.programmering.java,es.comp.lenguajes.java Subject: jdbc:odbc & unicode Date: Thu, 5 Jun 2003 13:49:00 +0200 Organization: Portal Gazeta.pl -> http://www.gazeta.pl Lines: 41 Message-ID: <bbnaoq$fbn$2@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