JDBC thin driver connection problems using cybersafe authentication

Hi
i am trying to use jdbc thin driver to connect to oracle 8.1.7 DB using ASO and cybersafe authentication.
Question:
Does the oracle jdbc thin driver in 8.1.7.0.0 support third-party authentication features supported by Oracle Advanced Security--such
as those provided by RADIUS, Kerberos, or SecurID
i am getting the following error.
Exception in thread "main" java.sql.SQLException: invalid arguments in call
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at ASOJdbc.main(ASOJdbc.java:43)
Following is the program i am trying.
public class ASOJdbc {
     public static void main(String args[]) throws SQLException {
          String url = "jdbc:oracle:thin:@son1129:1521:sonias";
          Connection con;
          String query = "select EMPNO, ENAME from EMP";
          Statement stmt;
          // ASO Stuff
               Properties props = new Properties();
               try {
               props.put("oracle.net.authentication_services", "CYBERSAFE");
               props.put("oracle.net.authentication_gssapi_service", "oracle/[email protected]");                    
               props.put("oracle.net.encryption_types_client", "DES");
               props.put("oracle.net.encryption_types_server", "DES");               
               props.put("oracle.net.crypto_seed", "4fhXXXX");               
               } catch (Exception e) { e.printStackTrace();
               DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
               // ASO
               con = DriverManager.getConnection(url, props);
               stmt = con.createStatement();
               ResultSet rs = stmt.executeQuery(query);
               stmt.close();
               con.close();          
jdk version: jdk 1.3.1
Oracle jdbc driver information, which i obtained as per Note 94091.1
=============
Database Product Name is Oracle
Database Product Version is Oracle8i Enterprise Edition Release 8.1.7.1.1 - Production With the Partitioning option
JServer Release 8.1.7.1.1 - Production
JDBC Driver Name is Oracle JDBC driver
JDBC Driver Version is 8.1.7.0.0
JDBC Driver Major Version is 8
JDBC Driver Minor Version is 1

1. What JDBC Thin client Driver are you using? (version) If you don't know, open up the Manifest.
2. the JDBC/OCI driver is a thick driver. It uses the oracle client, and therefore should read the tnsnames.ora
3. You have yet to give us any ORA- errors, which would help immensely in troubleshooting.

Similar Messages

  • Oracle JDBC Thin-Driver: Connection still valid (db still open)?

    Hi,
    I've got a problem with my program. The app opens a connection to an Oracle Database usingt the Oracle JDBC Thin.Driver. Everything works just fine but I can't figure out a way how to find out wheter the connection is still valid, e.g. if the database is still open?
    connection.isClosed() return always false :(
    Any help is appreciated.
    Thanks,
    Spaulding

    Hi oracle_guru,
    unfortunately it's not that easy. :(
    You can't just check for
    if(conn == null)since the connection won't realize when the db shuts down.
    Therefore I created a connection-watcher-thread which uses a prepared statement to check every once in while if the connection is still valid.
    Nevertheless, thanks for you reply,
    Spaulding

  • Jdbc thin driver connect oracle as internal

    I need to connect to Oracle as Internal using jdbc driver, is there a way we can do this using jdbc thin driver. Actually I don't want to pass username and password as it will be harcoded in a properties file.
    Please let me know.

    Hi Minol,
    Have a look at this code example that shows how to Connect to Database as internal ( as sysdba ). In this code sample the properties are hard-coded, you can supply these Properties by loading them from a properties file.
    Connecting to Oracle Database with DBA privileges
    http://myjdbc.tripod.com/basic/codeindex.html
    The code snippet to load properties from a properties file
    //Import IO related classes
    import java.io.IOException;
    // Necessary support classes
    import java.util.Properties;
    import java.util.Enumeration;
    import java.util.ResourceBundle;
       * This method reads a properties file which is passed as
       * the parameter to it and load it into a java Properties
       * object and returns it.
       * @param file File path
       * @return Properties The properties object
       * @exception IOException if loading properties file fails
       * @since 1.0
      public static Properties loadParams(String file)
          throws IOException {
        // Loads a ResourceBundle and creates Properties from it
        Properties     prop   = new Properties();
        ResourceBundle bundle = ResourceBundle.getBundle(file);
        // Retrieve the keys and populate the properties object
        Enumeration enum = bundle.getKeys();
        String      key  = null;
        while (enum.hasMoreElements()) {
          key = (String) enum.nextElement();
          prop.put(key, bundle.getObject(key));
        return prop;
      }Regards
    Elango.

  • Oracle 7 - JDBC Thin driver - connect - compatibility

    When logging on to an Oracle server v.7.2.3.0.0 with JDBC-thin
    driver (classes111.zip), I get the message:
    ORA-01017 invalid username/ password; logon denied
    even if the password, username and connection string is correct.
    The connection worked OK until some work was performed on the
    database and some changes with SQL*Net was done.
    I thought the driver worked OK with all versions of SQL*Net
    listeners?
    The database can be connected to with SQL*Plus.
    null

    I have the same problem trying to connect to database cache on iAS with iAS.

  • JDBC Thin driver connection

    Hi,
    I am trying to open a connection from Java using JDK 1.1.6 and the Oracle JDBC Thin drivers. My Oracle drivers register just fine. However, I get an exception which I catch saying "Security.couldn't connect to HOST with origin from." HOST is my local server name where I'm running Oracle 8.0.4.0.0 and OAS 4.0.8. My connection statement in my .java code is:
    Connecttion conn =
    DriverManager.getConnection("jdbc:oracle:thin@HOST:1521:orcl,"scott","tiger")
    I can connect just fine using sqlplus with the scott/tiger@orcl descriptor.
    How can I resolve this?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JDBC Development Team:
    Not sure whether this is the cause of the problem. There should be a ":" before the "@" sign in the connect string. That is,
    "jdbc:oracle:thin:@host"
    Please do let us know if this doesn't fix the problem
    <HR></BLOCKQUOTE>
    Thank you for pointing out the missing : before the @ symbol. I made that change. Still, I get the same message when the applet loads in my browser page. If I load the applet in appletviewer then I get the error message "checkconnect.networkhost1".

  • JDBC Thin Driver Won't Honor Autocommit=FALSE

    I have the following code, which intializes a JDBC thin driver connection, and sets the autocommit to false. However, as soon as the statement is executed, it commits on its own. What's going wrong here? I can tell that it is committing, because the calendar events all disappear, even if the code is terminated before committing, or in an endless loop.
    odsSecondary = new OracleDataSource();
    odsSecondary.setDatabaseName("####");
    odsSecondary.setDriverType("thin");
    odsSecondary.setUser("####");
    odsSecondary.setPassword("####");
    odsSecondary.setPortNumber(1521);
    odsSecondary.setServerName("####");
    connectionSecondary = odsSecondary.getConnection();
    connectionSecondary.setAutoCommit(false);
    Statement stmtSecondary = connectionSecondary.createStatement();
    stmtSecondary.executeUpdate("truncate table cal_events");

    The truncate command always issues a commit. refer to the oracle SQL documentation

  • OS Authentication using JDBC Thin driver

    Hi
    I have a problem while connecting to Oracle database using JDBC Thin Driver, Basically I am trying to connect using OS Authentication. The following explains clearly what I am trying to do.
    String connectionURL = "jdbc:oracle:thin:@localhost:1521:XYZ";
    String userName = "/";
    String password = "";
    java.util.Properties info = new java.util.Properties();
    info.setProperty("user",userName);
    info.setProperty("password",password);
    conn = DriverManager.getConnection(connectionURL,info);
    When executing the code I am getting an exception as follows.
    java.sql.SQLException: Null user or password not supported in THIN driver
    When i searched in the Oracle site i got the below information
    Note:
    By default, the JDBC driver retrieves the OS username from the user.name system property, which is set by the JVM. If the JDBC driver is unable to retrieve this system property or if you want to override the value of this system property, then you can use the OracleConnection.CONNECTION_PROPERTY_THIN_VSESSION_OSUSER connection property. For more information, see Oracle Javadoc.
    I want to know how to set the OracleConnection.CONNECTION_PROPERTY_THIN_VSESSION_OSUSER connection property.
    Advance Thanks

    Based on your code, when you try to connect your username is null and the password is "/". You are not going to be able to get the OS password using Java.

  • Connection error to 9i database using JDBC thin driver

    When trying to connect to a new 9i database using the JDBC thin driver, I received the following error:
    java.sql.SQLException: ORA-00600: internal error code, arguments: [ttcgcshnd-1], [0], [], [], [], [], [], []
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
    at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java)
    at oracle.jdbc.ttc7.Oall7.receive(Oall7.java)
    at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java)
    at oracle.jdbc.ttc7.TTC7Protocol.fetch(TTC7Protocol.java)
    at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java)
    at oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java)
    at oracle.jdbc.driver.OracleDatabaseMetaData.getTables(OracleDatabaseMetaData.java)
    I have no problem with my code connecting to an Oracle 8 database, just 9i.
    I'm trying to debug in Visual Cafe (JDK 1.1.7) and have both the classes111.zip and the nls_charset11.zip in my CLASSPATH.
    Any suggestions would be appreciated. Thanks

    If you're using 8i 8.1.7.1 or 8i 8.1.7.0 thin JDBC drivers on NT, then you can get them to connect to 9i by applying the 8i 8.1.7.1 Patch available at:
    http://technet.oracle.com/software/tech/java/sqlj_jdbc/htdocs/solsoft.html
    You might have to register/login first.
    Basically, it's just a case of replacing a class already in your classes111.zip or classes12.zip with the class in the patch.
    Took me a while to find this, but it worked first time after patching. Hope this helps.

  • Problem using JDBC Thin driver with Oracle 8i Personal Edition

    Hi all, I have an issue I have been unable to figure out. In order to make my code as portable as possible I am using the JDBC thin driver to access my database. I have been able to connect to an instance of Oracle 8i on a Sun box by hardcoding the following string into getConnection() call:
    conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(COMMUNITY=tcp.world)(PROTOCOL=TCP)(Host=<myhostname>)(Port=1521))(ADDRESS=(COMMUNITY=tcp.w orld)(PROTOCOL=TCP)(Host = <myhostname>)(Port = 1526)))(CONNECT_DATA = (SID = <mysidname>)))", <myuser>, <mypassword>);
    My problem is that I cannot figure out what string to use to connect to my local instance of Oracle 8i Personal. I used the following string (the sid I got from the looking at the init.ora file):
    conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(COMMUNITY=tcp.world)(PROTOCOL=TCP)(Host=localhost)(Port=1521))(ADDRESS=(COMMUNITY=tcp.world)(PRO TOCOL=TCP)(Host = localhost)(Port = 1526)))(CONNECT_DATA = (SID = orcl)))", "scott", "tiger");
    That didn't work, so I took the only entry found in my tnsnames.ora file in as:
    conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)))(CONNECT_DATA = (SID = PLSExtProc)(PRESENTATION = RO)))", "scott", "tiger");
    I am not knowing what is wrong, but that didn't work neither. Any suggestions would be highly appreciated.
    Thanks....
    null

    try this:
    conn = DriverManager.getConnection("jdbc:oracle:thin:scott/tiger:@hostname:1521:sid");
    or use system/manager as username/passward
    null

  • SSL connection with JDBC thin driver

    I am attempting to connect to an instance of Oracle 10.2 using the JDBC thin driver with SSL. I want to use the encryption feature of SSL only, but I can not perform the getConnection on the DataSource without running into an exception. According the JDBC docs, the SSL encryption feature is new for the 10.2 release of the JDBC thin driver, but I have seen no working examples. See http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/overvw.htm#CHDIHFBD
    I am using ojdbc14.jar on Java 5.0 using a standalone application, and it fails with an IOException (The network adapter could not establish the connection) (Error code 17002). I even enabled tracing using the ojdbc-g.jar to try to figure out what the REAL problem is, but it was not helpful at determining a root cause. I changed the driver type from "thin" to "oci" (and installed Oracle Instant client for my test machine) and the connection works just fine using the same tnsnames file, the same wallet, and the same cipher suite. From the Java perspective the only thing that changed was four characters -> "thin" became "oci". I am still using password based authentication as I understand that the authentication part of SSL is not supported in the thin driver on 10.2
    Can anyone verify that the SSL encryption works with JDBC thin as advertised? (not the Oracle Net encryption, but rather the one described in Chapter 11 of the JDBC Developer's Guide. See http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/sslthin.htm#CHDFEICG
    I really would prefer to avoid using the OCI driver because of its dependencies on the native platform. Is there something special with how the users are created or how the JDBC API should be used? I am setting what I think to be appropriate parameters (oracle.net.wallet_location, oracle.net.cipher_suites) all to no avail. Does anyone have a working example they can provide?

    1) I would suggest posting this question over in the JDBC forum. The folks over there are far more likely to be able to help you.
    2) When you do post this question over there, I would strongly suggest posting some sample code/ configuration scripts so that folks can reproduce your problem on their local machines. That tends to make it far easier to debug the problem and/or to notice if you've missed a step.
    Justin

  • Oracle JDBC Thin Driver and Firewall Problem

    Hi!
    We have Oracle 8.1.5 and Websphere App Server. There is a
    firewall between the two. A servlet creates a connection pool
    (not that of Wesphere's). The frontend is JSP/HTML (no applets).
    The servlet uses the Oracle JDBC Thin Driver for DB Connections.
    The problem is - Once the connection is freed, the connection
    pool is not being able to retrieve it and hence it created
    another one, thus reaching the max. # of connections and the
    system hangs. Restarting the DB service flushes the connection
    and the application starts running again...
    There was a similar problem discussed in this forums long ago. I
    have not yet tried mentioning the firwall port and IP in the
    connection string. But apart from that, is there any other
    setting I need to do (on firewall or for the connectionstring)
    to deal with this problem?
    Someone had suggested to punch a hole in the firewall for the DB
    port - but we can not really do that in the current scenario...
    I would appreciate if anyone could share their experience
    regarding how they resolved this issue.
    Thanks in advance,
    Vijaya.

    One more question -
    Can we use Oracle JDBC OCI driver? We do not have any appletes...
    Does it have firewall issues too? Is there any other driver that
    we can use?
    Thanks,
    Vijaya.

  • Using Oracle JDBC Thin Driver

    We are trying to use the Oracle supplied JDBC thin driver directly from within a jar file we add for our application.
    The classes in the jar file directly connect to an oracle database via the thin driver.
    The problem we've encountered is that if the JDBC Connection object is held in memory, after some time, the connection times out for no reason.
    Is there some restriction with weblogic in connecting directly to database from a class file and then caching the connection reference? It almost seems as if weblogic is severing the connections.
    thank you,
    BJ

    Stefan,
    You are right, although I would recommend just having the
    TestConnectionOnReserve= true and the testTableName set. Refresh Minutes
    becomes kind of redundent when you set these values.
    TestConnsOnReserve allows the server to verify if a connection that the
    client/application has requested is good , otherwise it recreates this
    connection and gives it to the client/application.
    hth
    sree
    "Stefan" <[email protected]> wrote in message
    news:[email protected]...
    Hi Sree,
    If instead a WL connection pool would be used this issue could be solved
    using
    "Refresh Period" and TestTableName right? In this case the connection would
    be
    alive as long as WL server is up. As a bonus we would have an automatic
    reconnection
    after an Oracle server reboot?
    thanks, stefan
    "Sree Bodapati" <[email protected]> wrote:
    Hi BJ,
    When you get connection directly using the Oracle thin driver, this is
    for
    sure your database timing out the connection when no activity is detected
    for sometime. You should consult with your DBA to ensure this timeout
    is set
    to a higher value at the server or ensure you dont hold on to theconnection
    for long durations or ensure you handle this situation by triggering
    a
    generic oracle process so that you periodically keep the connection busy
    to
    ensure that the database does not close it.
    This shouldnt be anything to do with WebLogic as you dont seem to be
    using
    WebLogic connection pool.
    hth
    sree
    "BJ Choi" <bongjin.choi@neoforma> wrote in message
    news:[email protected]...
    We are trying to use the Oracle supplied JDBC thin driver directly from
    within a jar file we add for our application.
    The classes in the jar file directly connect to an oracle database via
    the
    thin driver.
    The problem we've encountered is that if the JDBC Connection object is
    held
    in memory, after some time, the connection times out for no reason.
    Is there some restriction with weblogic in connecting directly to database
    from a class file and then caching the connection reference? It almost
    seems
    as if weblogic is severing the connections.
    thank you,
    BJ

  • Connection Problem using oracle.jdbc.xa.client.OracleXADataSource

    Unable to get a connection from connection pool Realm1tx
    Actually there are 5 connection intialized but no connection is there in active pool.Sometimes when I
    go to weblogic console and refresh the connection comes alive temporarily.Can anyone help me out for
    fixing this problem
    Driver Used:
    oracle.jdbc.xa.client.OracleXADataSource
    Error Message
    Unknown error occurred: XA error: XAER_RMERR : A resource manager error has occured in the transaction
    branch start() failed on resource 'realm1tx' null sql=[SELECT Person$1.id,NULL,Person$1.id,NULL,NULL
    FROM Person Person$1 WHERE (Per
    son$1.securityId = 'admin')] throttle=[-1]
    java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured in the transaction
    branch start() failed on resource 'realm1tx' null
    Thanks in advance.
    Ragavendra.

    Which version of oracle thin driver are you using? Oracle 920 thin driver has some issues.
    Thanks,
    Mitesh
    Ragavendra wrote:
    Unable to get a connection from connection pool Realm1tx
    Actually there are 5 connection intialized but no connection is there in active pool.Sometimes when I
    go to weblogic console and refresh the connection comes alive temporarily.Can anyone help me out for
    fixing this problem
    Driver Used:
    oracle.jdbc.xa.client.OracleXADataSource
    Error Message
    Unknown error occurred: XA error: XAER_RMERR : A resource manager error has occured in the transaction
    branch start() failed on resource 'realm1tx' null sql=[SELECT Person$1.id,NULL,Person$1.id,NULL,NULL
    FROM Person Person$1 WHERE (Per
    son$1.securityId = 'admin')] throttle=[-1]
    java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured in the transaction
    branch start() failed on resource 'realm1tx' null
    Thanks in advance.
    Ragavendra.

  • Jdbc thin driver to connect oracle as internal

    I need to connect to Oracle as Internal using jdbc driver, is there a way we can do this using jdbc thin driver. Actually I don't want to pass username and password as it will be harcoded in a properties file.
    Please let me know.

    Hi Minol,
    Have a look at this code example that shows how to Connect to Database as internal ( as sysdba ). In this code sample the properties are hard-coded, you can supply these Properties by loading them from a properties file.
    Connecting to Oracle Database with DBA privileges
    http://myjdbc.tripod.com/basic/codeindex.html
    The code snippet to load properties from a properties file
    //Import IO related classes
    import java.io.IOException;
    // Necessary support classes
    import java.util.Properties;
    import java.util.Enumeration;
    import java.util.ResourceBundle;
       * This method reads a properties file which is passed as
       * the parameter to it and load it into a java Properties
       * object and returns it.
       * @param file File path
       * @return Properties The properties object
       * @exception IOException if loading properties file fails
       * @since 1.0
      public static Properties loadParams(String file)
          throws IOException {
        // Loads a ResourceBundle and creates Properties from it
        Properties     prop   = new Properties();
        ResourceBundle bundle = ResourceBundle.getBundle(file);
        // Retrieve the keys and populate the properties object
        Enumeration enum = bundle.getKeys();
        String      key  = null;
        while (enum.hasMoreElements()) {
          key = (String) enum.nextElement();
          prop.put(key, bundle.getObject(key));
        return prop;
      }Regards
    Elango.

  • Sql_trace does not work for Java app using Oracle JDBC thin driver

    Hi,
    I'm using Oracle 8.1.7. I enabled sql trace at instance level by setting sql_trace and timed_statistics to true in init.ora. I restarted the db instance. I wrote a stand-alone java application which used Oracle JDBC thin driver(classes12.zip) to make a connection to my db instance, do some select statements, and close the connection. There were no trace files generated in the folder specified by udump_dest variable. However, if I used sqlplus or dba studio, I saw trace files generated. Has anyone got Oracle sql trace work for JDBC calls from java apps.
    Thanks in advance!

    Hi,
    I'm using Oracle 8.1.7. I enabled sql trace at instance level by setting sql_trace and timed_statistics to true in init.ora. I restarted the db instance. I wrote a stand-alone java application which used Oracle JDBC thin driver(classes12.zip) to make a connection to my db instance, do some select statements, and close the connection. There were no trace files generated in the folder specified by udump_dest variable. However, if I used sqlplus or dba studio, I saw trace files generated. Has anyone got Oracle sql trace work for JDBC calls from java apps.
    Thanks in advance!

Maybe you are looking for

  • Oracle.apps.xdo.template.fo.area.NoAvailableAreaException

    Hi We are getting below error for Commercial invoice report for some deliveries (with more than one order) Template code: SDSCOMINVKBI Template app: SDS Language: en Territory: 00 Output type: PDF [6/29/12 6:14:26 AM] [UNEXPECTED] [582604:RT86396421]

  • Performance Problem in parsing large XML file (15MB)

    Hi, I'm trying to parse a large XML file(15 MB) and facing a clear performance problem. A Simple XML Validation using the following code snippet: DBMS_LOB.fileopen(targetFile, DBMS_LOB.file_readonly); DBMS_LOB.loadClobfromFile tempCLOB, targetFile, D

  • It wont even let me update!!

    Well unlike most of everyone elses problems itunes wont even let me upgrade to 7. Ive been trying to for a long time...so i go to million season finale download thingy, and it tells me i have to download the new itunes 7 to proceed. it takes me to th

  • Xmltype column design

    hi all, i've recently implementing a project which need to stored hierarchical data. since relational db alone can only offer flatfile and implementing hierarchical data using realtional table with design structure such as 1. MPTT(Modified Preorder T

  • MacBook Pro won't wake up my lexmark printer...

    After my Lexmark Pinnacle Pro901 printer goes into energy saver mode or to "sleep" I can not wake it up by printing from my MacBook Pro. I can wake it up if I turn on my netbook and try to print and never had problems with the PC that was connected p