Problem with Jdbc Thin driver
Date: 1998/01/11
Message-ID: <34B8F60D.615604DF_at_mx2.redestb.es>#1/1
Hi Everybody !!
I'm trying to connect Personal Oracle 7.3.3.0 with jdbc. Previously i created and started a listener using loopback.
Started the listener without any problems at t:127.0.0.1:1521:orcl
I get the Oracle jdbc thin driver from Oracle. Compile this sample without any problems
/* * This sample shows how to list all the names from the EMP table * * It uses the JDBC THIN driver. See the same program in the * oci7 or oci8 samples directories to see how to use the other drivers.
*/
// You need to import the java.sql package to use JDBC import java.sql.*;
class Employee
{
public static void main (String args [])
throws SQLException, ClassNotFoundException
{
// Load the Oracle JDBC driver
Class.forName ("oracle.jdbc.driver.OracleDriver");
// Connect to the database
// You must put a database name after the _at_ sign in the connection
URL.
// You can use either the fully specified SQL*net syntax or a short
cut
// syntax as <host>:<port>:<sid>. The example uses the short cut
syntax.
Connection conn =
DriverManager.getConnection
("jdbc:oracle:thin:127.0.0.1:1521:orcl",
"scott", "tiger");
// Create a Statement
Statement stmt = conn.createStatement ();
// Select the ENAME column from the EMP table
ResultSet rset = stmt.executeQuery ("select ENAME from EMP");
// Iterate through the result and print the employee names
while (rset.next ())
System.out.println (rset.getString (1));
}
}
I try to execute it but i get the following error messages
C:\jdbc\samples\thin>java Employee
java.sql.SQLException: Refused:OR=(CODE=12505)(EMFI=4))))
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:203) at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:100)
at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:146)
at java.sql.DriverManager.getConnection(DriverManager.java:91) at java.sql.DriverManager.getConnection(DriverManager.java:134) at Employee.main(Employee.java:24)
Please anybody can help me ?
e-mail me also if possible
Jose Luis Perez Garcia || jlpg_at_geocities.com
|| perezjl_at_mx2.redestb.es ===================================================http://www.geocities.com/SiliconValley/Pines/4148/ http://www.redestb.es/personal/perezjl/
____ __ ____ ___ | Enginyer Tecnic (_ _)( ) ( _ \ / __) | en informatica .-_)( )(__ )___/( (_-. | de Sistemes \____) (____)(__) \___/ | F.I.B ===================================================Received on Sun Jan 11 1998 - 00:00:00 CET