Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

JDBC-ODBC SQL ResultSet Type Error

aslinda19aslinda19 Member Posts: 3
I am using jdbc-odbc bridge to connect to my navision database and when i compile, i received an sql exception error indicating that there is resultset type not supported. This is how i do it:

public class CreateCourseInfo{

public static void main(String[] args ) {

// Load the ODBC driver
try {
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
}
catch (ClassNotFoundException e) {
System.err.println("Could not load the JDBC-ODBC Bridge");
return;
}

try {
FileOutputStream fos = new FileOutputStream("CourseInfo.xml");
Writer out = new OutputStreamWriter(fos, "UTF8");

out.write("<?xml version="1.0"?>
");
out.write("
");

try{
writeCourse(out);
}catch (IOException e){
System.err.println("Error in retrieving data!");
}
out.write("
");
out.close();
}
catch (IOException e) {
System.err.println("System Error!");
}


}

private static void writeCourse(Writer out) throws IOException {

Connection conn = null;
Statement stmnt = null;
ResultSet course = null;

try {
conn = DriverManager.getConnection("jdbc:odbc:xxx","xxx", "");

DatabaseMetaData conMD = conn.getMetaData();
System.out.println("Driver Name: " + conMD.getDriverName());
System.out.println("Driver Version: " + conMD.getDriverVersion());

stmnt = conn.createStatement();
System.out.print("Get Connected!");
String query = "Select * from Course";
course = stmnt.executeQuery(query);
............

the exception occurs when it goes to this line --->>
stmnt = conn.createStatement();

plss help me!! how actually to solve the 'resultset type not supported' exception.



Comments

  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    \ http://forcoder.org \ free video tutorials and ebooks about || C++, Go, Delphi, Assembly, JavaScript, Visual Basic .NET, MATLAB, R, Java, C, Python, Visual Basic, Objective-C, C#, Scratch, Ruby, PL/SQL, PHP, Perl, Swift COBOL, Lua, Lisp, LabVIEW, Scala, Fortran, Ada, Erlang, Alice, Rust, D, SAS, Crystal, Kotlin, Transact-SQL, F#, Awk, Logo, VBScript, Dart, Bash, Hack, Julia, ML, Clojure, ABAP, Apex, Prolog, FoxPro, Scheme || _________

Sign In or Register to comment.