/ Forside / Teknologi / Udvikling / Java / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Java
#NavnPoint
molokyle 3688
Klaudi 855
strarup 740
Forvirret 660
gøgeungen 500
Teil 373
Stouenberg 360
vnc 360
pmbruun 341
10  mccracken 320
jdbc:odbc & unicode
Fra : jan himilsbach


Dato : 05-06-03 12:49

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("jdbcbc: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/

 
 
Søg
Reklame
Statistik
Spørgsmål : 177459
Tips : 31964
Nyheder : 719565
Indlæg : 6408193
Brugere : 218881

Månedens bedste
Årets bedste
Sidste års bedste