Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL Exception: IO Excetion

189396Jun 15 2002
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 23 2002
Added on Jun 15 2002
3 comments
346 views