public static void main(String[] args) {
// 间接方式连接数据库:配置数据源 try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:test", "",
"");
PreparedStatement pstmt = con
.prepareStatement("insert into jobs values(?,?,?)");
pstmt.setString(1, "shanghai");
pstmt.setShort(2, (short)100);
pstmt.setShort(3, (short)175);
int num = pstmt.executeUpdate();
if(num > 0)
System.out.println("OK");
else
System.out.println("Not Ok");
con.close(); } catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} }
[Microsoft][ODBC 驱动程序管理器] 在指定的 DSN 中,驱动程序和应用程序之间的体系结构不匹配
请教高手这问题怎么解决啊 急死我了哦
// 间接方式连接数据库:配置数据源 try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:test", "",
"");
PreparedStatement pstmt = con
.prepareStatement("insert into jobs values(?,?,?)");
pstmt.setString(1, "shanghai");
pstmt.setShort(2, (short)100);
pstmt.setShort(3, (short)175);
int num = pstmt.executeUpdate();
if(num > 0)
System.out.println("OK");
else
System.out.println("Not Ok");
con.close(); } catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
} }
[Microsoft][ODBC 驱动程序管理器] 在指定的 DSN 中,驱动程序和应用程序之间的体系结构不匹配
请教高手这问题怎么解决啊 急死我了哦
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货