62,616
社区成员
发帖
与我相关
我的任务
分享
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
connection = DriverManager.getConnection(url, username, password);
statement = connection.createStatement();
url是数据库的链接地址 例如:ODBC-JDBC连接 Jdbc:Odbc:数据源名字
username是数据库的用户名
password 是数据库的密码
statement.executeQuery(数据库语句);//查询 返回ResultSet对象
statement.executeUpdate(sql); //执行数据库更新语句