51,409
社区成员
发帖
与我相关
我的任务
分享
import java.sql.*;
public class access
{
/**
* @param args
* @throws CloneNotSupportedException
*/
public static void main(String[] args)
{
String driverName = "sun.jdbc.odbc.JdbcOdbcDriver";
String dbURL = "jdbc:odbc:jodbc";
// String dbURL="jdbc:odbc:jodbc"; //Êý¾ÝÔ´Á¬½Ó·½Ê½ DSN£ºtest
String userName = "";
String userPwd = "";
Connection dbConn = null;
try
{
Class.forName(driverName);
dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
Statement sql = dbConn.createStatement();
sql.executeUpdate("insert into t_tt(a) values('998')");
} catch (Exception e)
{
e.printStackTrace();
}
}
}
