JDBC connection using OCI8 driver type:
I am trying to run Oracle provided jdbc demo sample programs.
One of the java program is "DataSource.java"
If I compile and run this on unix server it works fine But
on windows and using "Eclipse" IDE it gives error.
Here is the error:
java.sql.SQLException: ORA-12560: TNSrotocol adapter error
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBE rror.java:134)
at oracle.jdbc.oci8.OCIDBAccess.check_error ( OCIDBAccess.java: 2321 ) .................

CLASSPATH is already set to $OH/jdbc/lib and it is tested. Other simple java code with following connection works fine
String url = "jdbcracle:thin:@<server>:1521:<SID>"; <<< working

I guess some environment is missing....??
Here is the code
// You need to import the java.sql package to use JDBC
import java.sql.*;
import javax.sql.*;
import oracle.jdbc.*;
import oracle.jdbc.pool.OracleDataSource;

public class DataSource
public static void main (String args [])
throws SQLException
// Create a OracleDataSource instance explicitly
OracleDataSource ods = new OracleDataSource();

// Set the user name, password, driver type and network protocol

// Retrieve a connection
Connection conn = ods.getConnection();
// Close the connection
conn = null;

static void getUserName(Connection conn)
throws SQLException
// Create a Statement
Statement stmt = conn.createStatement ();

// Select the USER column from the dual table
ResultSet rset = stmt.executeQuery ("select USER from dual");

// Iterate through the result and print the USER
while (rset.next ())
System.out.println ("User name is " + rset.getString (1));

// Close the RseultSet
rset = null;

// Close the Statement
stmt = null;