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!

java.lang.ClassCastException: oracle.jdbc.ttc7.TTC7Protocol

onst11Dec 20 2002 — edited Dec 24 2002

Hi,
I am trying to run the Ntier Authentication sample in JDBC Developer's Guide. I get above exception on the following line
**OracleOCIConnectionPool cpool = new OracleOCIConnectionPool("proxy","mehul", url, null);**The only thing I have changed in the code is the driver: thin instead off the thick OCI JDBC Driver.
What am I doing wrong?
Thanks,
Onno

/*
* A Ntier Authentication Sample
*
*/
import java.sql.*;
import javax.sql.*;
import java.util.Properties;
import oracle.jdbc.*;
import oracle.jdbc.pool.*;
import oracle.jdbc.oci.*;
class NtierAuth
{
public static void main (String args [])
throws SQLException
{
// Step 1: Connect as system/manager to create the users, setup roles andproxies.
// Load the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
//String url = "jdbc:oracle:oci8:@dorc";
System.out.println ("-- trace1");
String url = "jdbc:oracle:thin:@orcsun.cmg.nl:1521:dorc";
try {
System.out.println ("-- trace2");
String url1 = System.getProperty("JDBC_URL");
if (url1 != null)
url = url1;
} catch (Exception e) {
// If there is any security exception, ignore it
// and use the default
}
// Connect to the database as system/manager
System.out.println ("-- tra[i]

Long postings are being truncated to ~1 kB at this time.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 21 2003
Added on Dec 20 2002
2 comments
514 views