-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
1.3.0
-
sparc
-
solaris_2.6
Name: rmT116609 Date: 10/18/2000
miso{david}1: java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-RC)
Java HotSpot(TM) Client VM (build 1.3.0-RC, mixed mode)
The following simple program worked fine with our ODBC driver (StarSQL) and the
JDBC-ODBC bridge with JDK 1.1.8 & 1.2.1_04 on Solaris SPARC (as well as JDK
1.1.8 and 1.3 on Windows NT). However, it gives the following error with JDK
1.3 on SPARC.
I tried recompiling it with javac from 1.3 - no difference.
miso{david}7: java starsql
Exception in thread "main" java.sql.SQLException: The result set type is not sup
ported.
at sun.jdbc.odbc.JdbcOdbcStatement.initialize(JdbcOdbcStatement.java:154
)
at sun.jdbc.odbc.JdbcOdbcConnection.createStatement(JdbcOdbcConnection.j
ava:420)
at sun.jdbc.odbc.JdbcOdbcConnection.createStatement(JdbcOdbcConnection.j
ava:394)
at starsql.main(starsql.java:25)
miso{david}6: more starsql.java
import java.sql.*;
public class
starsql
{
public static void
main( String args[] )
throws Exception
{
int i;
for (i=0; i < 3; i++)
{
// Find the class...
Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
// Open a connection...
Connection myConnection = DriverManager.getConnection(
"jdbc:odbc:amelia",
"david",
"xyz" );
// Create a statement...
Statement myStatement = myConnection.createStatement();
// Execute a query...
try
{
// Execute the query...
myStatement.execute( "select * from admin.employee" );
// Get the result set...
ResultSet mySet = myStatement.getResultSet();
// Advance to the next row...
while ( mySet.next() )
{
// Get the data...
int empno = mySet.getInt( "empno" );
String ename = mySet.getString( "firstnme" );
String lname = mySet.getString( "lastname" );
long salary = mySet.getLong( "salary" );
// Print it all out...
System.out.println( Integer.toString( empno ) + " - " +
ename + " " + lname + " - $" + Long.toString( salary ) );
}
}
catch ( SQLException e )
{
System.out.println( "SQL Error: " + e.toString() );
}
// Close everything up...
myStatement.close();
myConnection.close();
}
}
}
(Review ID: 109584)
======================================================================