안녕하세요
저는 오라클8i를 레드햇6.1에 설치했습니다.
오라클을 구동시키고 리스너를 실행시킨후
jdbc연동을 시키려고 하는데 문제가 발생합니다.
리스너도 잘돌아가고 있는 것같은데 왜 연결이 거부되는지...
혹시 저와 같은 경험을 하신분이 없나요?
만약 있으시면 도움을 요청합니다.
참, sqlnet.ora화일이 필요한건지도...그렇다면 설정은 어떻게?
(에러결과)
java.sql.SQLException: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=135286784)(ERR=12500)(ERROR_STACK=(ERROR=(CODE=12500)(EMFI=4))(ERROR=(CODE=12533)(EMFI=4))(ERROR=(CODE=12560)(EMFI=4))(ERROR=(CODE=503)(EMFI=4))(ERROR=(BUF=''))))
----------------------------------------------------------------------------
(listener.ora file)
LISTENER=
(ADDRESS_LIST=
(ADDRESS=
(PROTOCOL=tcp)
(HOST=?.?.?.?)
(PORT=1521)
)
)
STARTUP_WAIT_TIME_LISTENER = 0
CONNECT_TIMEOUT_LISTENER = 10
SID_LIST_LISTENER=
(SID_LIST =
(SID_DESC=
(SID_NAME=ORA815)
(ORACLE_HOME=/home/8i/app/oracle/product8.1.5)
(GLOBAL_DBNAME=?.?.?.?)
(ENVS='EPC_DISABLED=TRUE')
)
)
TRACE_LEVEL_LISTENER = OFF
TRACE_LEVEL_LISTENER = ADMIN
TRACE_DIRECTORY_LISTENER = /home/8i/app/oracle/product8.1.5
TRACE_FILE_LISTENER = listener.trc
LOG_DIRECTORY_LISTENER =/home/8i/app/oracle/product8.1.5
LOG_FILE_LISTENER = listener.log
USE_CKPFILE_LISTENER=TRUE
----------------------------------------------------------------------------
# Filename: Tnsnames.ora
#
extproc_connection_data =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = ORA815))
(CONNECT_DATA = (SID = extproc))
)
ORA815 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL= TCP)(Host= ?.?.?.? )(Port= 1521))
(CONNECT_DATA = (SID = ORA815))
)
ORA815_BEQ =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = BEQ)(PROGRAM = /home/8i/app/oracle/product/8.1.5)
(argv0 = oracleORA815)
(args = '(DESCRIPTION = (LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ)))')
(envs = 'ORACLE_HOME=/home/8i/app/oracle/product/8.1.5,ORACLE_SID=ORA815')
)
)
-------------------------------------------------------------------------
(프로그램소스)
// Import the JDBC classes
import java.sql.*;
// Import the java classes used in applets
import java.awt.*;
import java.io.*;
import java.util.*;
class test4
{
public static void main (String args []) throws SQLException, ClassNotFoundException {
try {
Class.forName ("oracle.jdbc.driver.OracleDriver");
System.out.println ("Connect ...1");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@?.?.?.?:1521:ORA815", "scott", "test");
System.out.println ("Connected ...2");
Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery ("select ENAME from EMP");
while (rset.next ()) {
System.out.println (rset.getString (1));
}
conn.close();
} catch (Exception e) {
e.printStackTrace();
System.out.println(e.toString());
}
}
}
|