SQL Exception: IO Excetion
Hi All,
When my Java Class connects to the database it gets the following SQL Exception:
SQL EXception: Io Exception: Connection refused(DESCRIPTION-(TMP=)(VSNNUM=150999297)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
The code I am using is :
import java.io.*;
import java.sql.*;
import java.util.*;
import java.lang.*;
import java.sql.Date;
import java.sql.SQLException;
import sqlj.runtime.ref.*;
import oracle.sqlj.runtime.Oracle;
public class HelloWorld {
public static void main(String[] args) {
java.sql.Date current_date;
try {
// connect to the database
//Oracle.connect("jdbc:oracle:thin:@x4uwmd_pc.fanniemae.com:1521:vndbprod","vnuser","vnuser");
System.out.println("Before Conn");
Oracle.connect("jdbc:oracle:thin:@172.21.67.3:1521:vndbdev","scott","tiger");
System.out.println("After Conn");
// get the current date from the database
#sql { SELECT sysdate INTO :current_date FROM dual };
// display message
System.out.println("Hello World! The current date is " +
current_date);
} catch ( SQLException e ) {
System.err.println("SQLException 1: " + e);
} finally {
try {
// disconnect from the database
Oracle.close();
} catch ( SQLException e ) {
System.err.println("SQLException 2: " + e);
}
}
} // end of main()
}
Any help please!!
Thanks!!
Shalu