File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes jdbc in Unix Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "jdbc in Unix" Watch "jdbc in Unix" New topic

jdbc in Unix

Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235

I run a simple program on Solaris. It gave the following error:
Error Connecttion
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(
at java.sql.SQLException.<init>(
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.driver.OracleConnection.<init>(
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
at oracle.jdbc.driver.OracleDriver.connect(
at java.sql.DriverManager.getConnection(Compiled Code)
at java.sql.DriverManager.getConnection(
at JdbcTest.doTest(Compiled Code)
at JdbcTest.main(
The URL and driver are correct,
What is the problem?
Monty Ireland
Ranch Hand

Joined: Oct 03, 2000
Posts: 161
I got a simular error on NT a few months ago.
1. Do you have the oracle jdbc driver in you classpath?
2. Has Net8 been stup correctly.
3. Is your URL refering to the thin client or OCL driver.
1. copy of path
2. copy of classpaht
3. copy of Class.forNames
4. copy of your URL
TTFN, Monty

Multi-Platform Database Developer ( on E.S.T. )

Multi Platform Database Developer & DBA on E.S.T.
Simon Xu
Ranch Hand

Joined: Aug 16, 2000
Posts: 235
hi, Monty,
Thanks for your reply. It is not classpath or drive problem, as another program runs OK. Here is the code:
import java.sql.*;
public class JdbcTest1 {
public void doTest(){
try{ Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con =DriverManager.getConnection( "jdbc", "simon", "p548") ;
Statement stmt = con.createStatement();
System.out.println("Table Created?"+ stmt.executeUpdate( "create table mytable (sno integer, name varchar(20) )")); System.out.println("Inserted?"+ stmt.executeUpdate("insert into mytable values (1, 'Silly')"));
System.out.println("Inserted?"+stmt.executeUpdate ("insert into mytable values (2, 'Ken')"));
ResultSet rs = stmt.executeQuery("select * from mytable");
while ( ){
System.out.println("SNO==>" + rs.getInt("sno")+"\n");
System.out.println("SNO ==>"+ rs.getString("name")+"\n");
}catch (Exception e){
System.out.println("Error Creating Record");
public static void main( String[] args ) {
JdbcTest1 test = new JdbcTest1();
I agree. Here's the link:
subject: jdbc in Unix
It's not a secret anymore!