Non-English string access from excel sheet through JDBC
My excel sheet data is
Test笛椐慌亍闼凌
I am using JDBC connectivity for accessing the Excel sheet.
Code looks like,
/***************************************************************************/
List Output = new List();
try
{
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
c = DriverManager.getConnection( "jdbc:odbc:qa-list", "", "" );
stmnt = c.createStatement();
ResultSet rs = stmnt.executeQuery("select * from [Sheet1$];");
ResultSetMetaData rsmd = rs.getMetaData();
int numberOfColumns = rsmd.getColumnCount();
for(int i=1; i <= numberOfColumns; i++){
Output.add(rsmd.getColumnLabel(i));
}
catch( Exception e )
{
System.err.println( e );
}
finally
{
try
{
stmnt.close();
c.close();
}
catch( Exception e )
{
System.err.println( e );
}
}
/****************************************************************************************/
Now. I am showing those data into the table(JTable) Applet programming.
For, English string it is showing properly but, for non-English string are showing ?br>
I would like to know what could be the reason.
Addional info:
ava version "1.6.0_01"
Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)
If possible please send some reference code .
[1506 byte] By [
swapan007a] at [2007-11-27 8:30:47]

# 1
I don't even think that the ODBC driver supports unicode so I'm not sure there is any hope for this working.
# 2
If Unicode access is not possible through JDBC, so there is no use for country specific language.As of my knowledge Excel support UTF-8 for that reason it is able to show different languages..If anybosy has any idea about acessing non-english chars please share with me..
# 3
> If Unicode access is not possible through JDBCThat is NOT what I said at all.JDBC supports unicode.I do not believe that ODBC supports Unicode. I know that the newer MS drivers do, but they are not ODBC.
# 4
Hello,In my program, I am using JDBC connectivity. eventhrough, I am not able to show, non-english chars.Please give me, some solutions for the above problem. in my last message, I have posted the code also.Please help me..
# 5
Hmmm interesting. Please tell me more.
# 6
I have one excel sheet which having differenct countries specific meaining of common words.
I am using JDBC connectivity for accessing that Excel sheet.
Code looks like,
/***************************************************************************/
List Output = new List();
try
{
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
c = DriverManager.getConnection( "jdbc:odbc:qa-list", "", "" );
stmnt = c.createStatement();
ResultSet rs = stmnt.executeQuery("select * from [Sheet1$];");
ResultSetMetaData rsmd = rs.getMetaData();
int numberOfColumns = rsmd.getColumnCount();
for(int i=1; i <= numberOfColumns; i++){
Output.add(rsmd.getColumnLabel(i));
}
catch( Exception e ){
System.err.println( e );
}
finally{
try{
stmnt.close();
c.close();
}
catch( Exception e ){
System.err.println( e );
}
}
/****************************************************************************************/
Now. I am showing those output data into the table(JTable) in my Applet programming.
For, English string it is showing properly but, for non-English strings are showing question marks like, ?br>
I would like to know what could be the reason.
Please help me, i am stuck in my project.
# 7
Fascinating, totally riveting stuff. Please continue.
# 8
Now tell me how to get the unicode string from excel sheet..
# 9
What do you want to do?
# 10
I want to access excel sheet rows, which having different languuage strings like Arabic, thai, english etc.
To show the data into my application corresponding table.
Basically, i have a hugh database as excel sheet, based on my query request, I want to how the output into my application.
But, for non-english chars are showing like "?".
I would like to show the actual string instead of some juck chars.
I hope so, i am able to express my query.
Please help me to solve my problem.
# 11
Have you investigated whether or not the ODBC driver supports this?
# 12
I am new to this area.I don't know, how to check whether, it has support or not.Can you tell me, how to check?
# 13
> I am new to this area.> I don't know, how to check whether, it has support or> not.> Can you tell me, how to check?Google
# 14
Perhaps this will help:
In order to connect to a database, you need a database driver.
There are two types of drivers. They are ODBC drivers and JDBC drivers. The ODBC drivers implement an older standard that may not be able to handle unicode characters (and therefore not foriegn languages). I dont know if that it true and I am assuming the other posts on this web site is correct in that opinion. The JDBC drivers are a newer standard that can apparently can handle unicode characters.
In your code, you have the following line:
sun.jdbc.odbc.JdbcOdbcDriver
This is a ODBC driver.
Go to http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/bridge.doc.html
and click on the "list of drivers currently available. " link to search for a JDBC driver for your particular database.
If it still will not work, I suggest talking to the database driver supplier and asking them if your problem for foriegn languages is caused by the limitations of thier drivers.
You proably need a JDBC driver, type 3 or type 4. Do not pick type 1 or type2 since they are older JDBC drivers.
