aspose file tools
The moose likes JDBC and the fly likes database connection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "database connection" Watch "database connection" New topic
Author

database connection

jayashri hosur
Greenhorn

Joined: Jun 05, 2008
Posts: 8
hi,
i am getting error by running the below code so help me please
Class.forName("oracle.jdbc.driver.OracleDriver");

String url="jdbcracle:thin:@localhost:1521:sid";

System.out.println("urllllllllll"+url);

Connection conn;

try {

conn = DriverManager.getConnection(url,sysusername,syspassword);

System.out.println("connnnnnnnn"+conn);



Statement stmt = conn.createStatement();



} catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}





adding classes111.jar and classes12.jar but I am getting this error



Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153092352)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
Yamil Bracho
Greenhorn

Joined: Mar 24, 2004
Posts: 1
It looks like you supply a wrong username/password...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16482
    
    2

"Connection refused" usually means there is no server running at the port you tried to connect to.

In your example, that's port 1521 on localhost. Are you running an Oracle server on the same computer where that code was running? And is it configured to listen at port 1521?
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: database connection
 
Similar Threads
Class.forName("")
connecting to Webtrends reporting DB using JDBC-ODBC
JDBC/Oracle access problem
jdbc
java lang NoClassDefFoundError