Thread View: de.comp.lang.java
1 messages
1 total messages
Started by jan himilsbach
Thu, 05 Jun 2003 11:49
jdbc:odbc & unicode
Author: 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/
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads