Hi All!
I am using easysoft jdbc-odbc bridge to connect to an access database. The following error is displayed.
java.sql.SQLException: Connection failed String index out of range: -33
java.lang.NullPointerException:
What might be the problem..
the code is
import java.* ;
import java.sql.* ;
public class FirstApp {
public static void main(String[] args){
System.out.println("First Program Hello World \n"
System.out.println("First1 Program1 Hello World1 \n"
Connection con=null;
ResultSet rs=null;
Statement stmt=null;
String query = "SELECT * from Tourist_Places" ;
String url="jdbc:easysoft://hostname:8031/dsnname:limit=30";
try{
Class.forName("easysoft.sql.jobDriver"
System.out.println("Driver Loaded"
}catch( Exception e){
System.out.println(e);
}
try{
con = DriverManager.getConnection(url);
System.out.println(" Connection Successfull"
}catch( Exception e){
System.out.println("Testing:"+e);
}
try{
stmt = con.createStatement();
System.out.println(" Statement Created"
rs = stmt.executeQuery(query);
String place = rs.getString("placeName"
String desc = rs.getString("Desc"
System.out.println(place + " " + desc);
}catch( Exception e){
System.out.println(e);
}
}
}
Note : In place of hostname I used my local system IP and inplace of dsnname my database dsn.
thanks in advance.
[sig][/sig]
I am using easysoft jdbc-odbc bridge to connect to an access database. The following error is displayed.
java.sql.SQLException: Connection failed String index out of range: -33
java.lang.NullPointerException:
What might be the problem..
the code is
import java.* ;
import java.sql.* ;
public class FirstApp {
public static void main(String[] args){
System.out.println("First Program Hello World \n"
System.out.println("First1 Program1 Hello World1 \n"
Connection con=null;
ResultSet rs=null;
Statement stmt=null;
String query = "SELECT * from Tourist_Places" ;
String url="jdbc:easysoft://hostname:8031/dsnname:limit=30";
try{
Class.forName("easysoft.sql.jobDriver"
System.out.println("Driver Loaded"
}catch( Exception e){
System.out.println(e);
}
try{
con = DriverManager.getConnection(url);
System.out.println(" Connection Successfull"
}catch( Exception e){
System.out.println("Testing:"+e);
}
try{
stmt = con.createStatement();
System.out.println(" Statement Created"
rs = stmt.executeQuery(query);
String place = rs.getString("placeName"
String desc = rs.getString("Desc"
System.out.println(place + " " + desc);
}catch( Exception e){
System.out.println(e);
}
}
}
Note : In place of hostname I used my local system IP and inplace of dsnname my database dsn.
thanks in advance.
[sig][/sig]