标签:ati void exec for pack ack into rman str
package tj.test.demo;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
public class SqlServerConnection {
public SqlServerConnection() {
// TODO Auto-generated constructor stub
}
public static void main(String...arg){
String driver="com.microsoft.sqlserver.jdbc.SQLServerDriver";
String url="jdbc:sqlserver://localhost:1433;databaseName=test_01";
String user="sa",password="123456"; //这里是你的sa账号密码
try {
Class.forName(driver);
} catch (ClassNotFoundException e) {
System.out.println("驱动加载失败");
}
java.sql.Connection con=null;
try {
con=DriverManager.getConnection(url,user,password);
Statement stmt= con.createStatement();
// String a1="INSERT INTO TABLE1 VALUES(‘1‘,‘旭哥‘)";
//插入数据SQL语句
//创建表
String a1="INSERT INTO USERS VALUES(‘1‘,‘xx‘)";
stmt.executeUpdate(a1);//执行SQL命令对象
} catch (SQLException e) {
System.out.println("连接失败");
}
if(con!=null)System.out.println("连接成功 : "+con);
}
}
标签:ati void exec for pack ack into rman str
原文地址:http://www.cnblogs.com/kongxc/p/6639856.html