JDBC 용 MSSQL 드라이버 http://microsoft.com/korea/msdn/MSDN-FILES/027/001/779/msdncompositedoc.asp
아래는 SqlTest2.java 파일
import java.sql.*;
class SqlTest2 {
public static void main(String[] arguments){
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://211.235.151.240:1433;DatabaseName=디비이름","아이디","암호");
Statement stmt = conn.createStatement();
stmt.executeUpdate("careate table mytable5(name varchar(10))");
System.out.println("ok");
stmt.close();
conn.close();
}catch (Exception e){
System.out.println("Error "+e.getMessage());
}
}
}
//con = DriverManager.getConnection("jdbc:microsoft:sqlserver://DB아이피:1433;DatabaseName=테이블명","계정","비번");
아래는 SqlTest2.java 파일
import java.sql.*;
class SqlTest2 {
public static void main(String[] arguments){
try{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://211.235.151.240:1433;DatabaseName=디비이름","아이디","암호");
Statement stmt = conn.createStatement();
stmt.executeUpdate("careate table mytable5(name varchar(10))");
System.out.println("ok");
stmt.close();
conn.close();
}catch (Exception e){
System.out.println("Error "+e.getMessage());
}
}
}
//con = DriverManager.getConnection("jdbc:microsoft:sqlserver://DB아이피:1433;DatabaseName=테이블명","계정","비번");
'StoreHouse > DataBase' 카테고리의 다른 글
Mysql 간략 사용법 2003/07/14 (0) | 2004.12.10 |
---|---|
Mysql processlist 죽이기 (0) | 2004.12.10 |
Oracle 의 SID 알아내기 2003 (0) | 2004.12.10 |
Redhat 7.1 + Oracle 8.1.7 설치법 2003/07/11 (0) | 2004.12.10 |
Mysql 설치,유저생성,외부접속 (0) | 2004.12.10 |