java - Establishing JDBC through SID -
i connecting oracle 11g db trough java program. using service name , not sid.
addr = jdbc:oracle:thin:@hostip:1521:servicename class.forname("oracle.jdbc.oracledriver"); connection con = drivermanager.getconnection(addr,un,pw); statement stat = con.createstatement(); resultset rs = stat.executequery(select * table);
this works great. able connect db , retrieve data.
however, if pass service id instead of service name, code doesn't work! exception. tried solution mentioned here - java jdbc - how connect oracle using service name instead of sid. still see same exception.
Comments
Post a Comment