我使用的是java语言,想通过JDBC访问ifix的实时数据库,可试了几次都出现一个问题,我把代码贴在下面,求大侠们帮忙看看!
import java.sql.*;
import javax.sql.*;
public class Fixs {
public static void main(String【】 args){
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
String sql;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:FIX Dynamics Real Time Data","","");
sql="select * from FIX"; //FIX是节点名。
stmt=conn.createStatement();
rs=stmt.executeQuery(sql);
while(rs.next()){
}
}catch(ClassNotFoundException cnfex){
System.out.println("装载JDBC/ODBC驱动程序失败。");
cnfex.printStackTrace();
System.exit(1);
}catch(SQLException sqlex){
System.out.println("连接数据库失败");
sqlex.printStackTrace();
System.exit(1);
}
}
}
错误信息::
The result set type is not supported.
at sun.jdbc.odbc.JdbcOdbcStatement.initialize(JdbcOdbcStatement.java:154)
at sun.jdbc.odbc.JdbcOdbcConnection.createStatement(JdbcOdbcConnection.java:422)
at sun.jdbc.odbc.JdbcOdbcConnection.createStatement(JdbcOdbcConnection.java:396)
at SelectData.Fixs.main(Fixs.java:22)
就是运行到下划线那行时,出现The result set type is not supported. ,实在不清楚怎么了,还请大家帮忙看看!不胜感激!