A
ahmed.JDev
Hello all,
i tried to read some data from Excel file via this code, but i got an
exception
( 'an$' is not a valid name..... )
hint: i made the settings in Control Panel>Administrative tools>Data
Sources(ODBC)
public class ExcelReader
{
public static void main( String[] args )
{
Connection c = null;
Statement stmnt = null;
try {
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
c = DriverManager.getConnection( "jdbcdbc:an-list", "", "" );
stmnt = c.createStatement( );
String query = "select URL from [an$] where Name='Ahmed Battah' and
Ext=213";
ResultSet rs = stmnt.executeQuery( query );
System.out.println( rs.getString( "URL" ) );
}
catch( Exception e ) {
System.err.println( e );
}
}
}
i tried to read some data from Excel file via this code, but i got an
exception
( 'an$' is not a valid name..... )
hint: i made the settings in Control Panel>Administrative tools>Data
Sources(ODBC)
public class ExcelReader
{
public static void main( String[] args )
{
Connection c = null;
Statement stmnt = null;
try {
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
c = DriverManager.getConnection( "jdbcdbc:an-list", "", "" );
stmnt = c.createStatement( );
String query = "select URL from [an$] where Name='Ahmed Battah' and
Ext=213";
ResultSet rs = stmnt.executeQuery( query );
System.out.println( rs.getString( "URL" ) );
}
catch( Exception e ) {
System.err.println( e );
}
}
}