>> 다음과 같은 에러는 어떨때 나오는 건가요?
jsp로 만든 웹페이지는 잘 접속이 되는데, Java로 구현한 클라이언트 프로그램에서는 무지 막히네요...ㅠㅠ;
com.tmax.tibero.jdbc.TbSQLException: TJDBC-90405:I/O error while reading from server. - Connection reset
at com.tmax.tibero.jdbc.comm.TbStream.readNBytes(TbStream.java:395)
at com.tmax.tibero.jdbc.comm.TbStream.readMsg(TbStream.java:338)
at com.tmax.tibero.jdbc.comm.TbCommType4.logon(TbCommType4.java:2057)
at com.tmax.tibero.jdbc.TbConnection.openConnection(TbConnection.java:516)
at com.tmax.tibero.jdbc.TbDriver.connectInternal(TbDriver.java:73)
at com.tmax.tibero.jdbc.TbDriver.connect(TbDriver.java:64)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at ConnectionTest.connect(ConnectionTest.java:42)
at ConnectionTest.main(ConnectionTest.java:110)
>> Tibero 구동서버에는 프로세스와 리스닝 포트를 다음과 같이 확인하였습니다. (또한 9027포트도 열었습니다)
C:\Documents and Settings\Administrator>tasklist | findstr tb
tblistener.exe 896 RDP-Tcp#11 0 3,456 K
tbsvr.exe 736 RDP-Tcp#11 0 378,004 K
tbAdmin.exe 5760 2 380 K
C:\Documents and Settings\Administrator>netstat -na | findstr 9027
TCP 0.0.0.0:9027 0.0.0.0:0 LISTENING
TCP 127.0.0.1:1295 127.0.0.1:9027 ESTABLISHED
TCP 127.0.0.1:9027 127.0.0.1:1295 ESTABLISHED
TCP 192.168.1.3:9027 192.168.1.199:52660 ESTABLISHED
>> 소스는 다음과 같이 하였습니다.
import java.sql.*;
import com.tmax.tibero.*;
public class ConnectionTest
{
Connection conn = null; //DB접속
Statement stmt = null; //SQL Statement
ResultSet rs = null; //SQL 실행결과
String strSQL = null; //SQL문
//Tibero JDBC Driver
String DB_DRV = "com.tmax.tibero.jdbc.TbDriver";
//Tibero 연결정보
String DB_IP = "192.168.1.3"; //Tibero IP
String DB_PORT = "9027"; //Tibero 접속 Port
String DB_SID = "tiberosid"; //Tibero SID
String DB_ID = "tiberouser"; //접속할 유저 ID
String DB_PWD = "tiberopass"; //접속할 유저 패스워드
String DB_URL = "jdbc:tibero:thin:@"+DB_IP+":"+DB_PORT+":"+DB_SID;
//생성자
public ConnectionTest()
{
}
//Tibero 접속
public void connect()
{
try
{
System.out.println("=====================================");
System.out.println("DB_DRV : " + DB_DRV);
System.out.println("DB_DRV : " + DB_URL);
System.out.println("DB_ID : " + DB_ID);
System.out.println("DB_PWD : " + DB_PWD);
System.out.println("-------------------------------------");
Class.forName(DB_DRV);
conn = DriverManager.getConnection(DB_URL, DB_ID, DB_PWD);
System.out.println("Tibero Connect Success");
System.out.println("=====================================");
System.out.println("");
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
//Tibero 접속종료
public void disconnect()
{
try
{
if (rs != null) rs.close();
if (stmt != null) stmt.close();
if (conn != null) conn.close();
}
catch (Exception ex)
{
ex.printStackTrace();
}
finally
{
if ( rs != null ) try { rs .close(); } catch(Exception e) {}
if ( stmt != null ) try { stmt .close(); } catch(Exception e) {}
if ( conn != null ) try { conn .close(); } catch(Exception e) {}
}
}
//Main 함수
public static void main (String [] args)
{
ConnectionTest test = new ConnectionTest();
test.connect();
test.disconnect();
}
}
|