반응형 Programming105 각종 DB JDBC 연결 1. Oracle 1). 서버환경 - 서버 주소 : 127.0.0.1 - 서비스 포트 : 1521 2). JDBC 설정 - Driver 클래스 : oracle.jdbc.driver.OracleDriver - URL 형식 : jdbc:oracle:thin:@127.0.0.1:1521 2. MySQL 1). 서버환경 - 서버 주소 : 127.0.0.1 - 서비스 포트 : 3306 - MySQL Database Name : mydb 2). JDBC 설정 - Driver 클래스 : com.mysql.jdbc.Driver - URL 형식 : jdbc:mysql://127.0.0.1:3306/mydb 3. MS-SQL 1). 서버환경 - 서버 주소 : 127.0.0.1 - 서비스 포트 : 1433 2). JDBC .. 2010. 8. 17. 인덱서 인덱스 생성 법 struct IntBits { public IntBits(int initialBitValue) { bits = initialBitValue; } //여기에 인덱서를 작성. public bool this[int index] { get { return (bits & (1 2010. 8. 6. 나열형(enum)과 구조체(struct) 선언. 나열 형식 선언하기 enum Season { Spring, Summer, Fall, Winter } 나열형 변수 선언하기 Season currentSeason; 나열형 변수에 값 지정하기 currentSeason = Spring; //오류 currentSeason = Season.Spring //올바름 구조체 선언하기 struct Time { public Time(int hh, int mm, int cc) { … } … private int hours, minutes, seconds; } 구조체 변수 선언하기 Time now; 구조체 변수에 값 초기화하기 Time lunch = new Time(12, 30, 0); 2010. 7. 20. JDK 1.6 + mssql 2005 연동하기. 마이크로소프트에 가서 mssql용 jdbc를 다운 받는다. sqljdbc_2.0.1803.100_kor.exe Connection conn=null; PreparedStatement pstmt = null; ResultSet rs = null; String sql = null; try{ String jdbcUrl="jdbc:sqlserver://주소:포트;DatabaseName=DB명"; String dbId="DB 접속 ID"; String dbPass="DB 접속 PASS"; Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); conn = DriverManager.getConnection(jdbcUrl,dbId,dbPass); sql = ".. 2010. 6. 25. 이전 1 ··· 8 9 10 11 12 13 14 ··· 27 다음 반응형