Issue encountered when Login as sysdba role using Thin Oracle JDBC Driver

Hello all,
we are now considering to use Thin oracle JDBC driver to create database in our project, but we met one issue when we tried to connect to oracle as sysdba role using Thin driver, and it throws java.sql.SQLException: Io Exception: SO Exception was generated, I have found some tips on oracle jdbc website and it says :
How do I connect as SYSDBA or SYSOPER?
The only way to do this is to use the Properties object when connecting, rather than specifying the username and password as strings. Put the username into the "user" property, and the password into the "password" property. Then, put the mode into the "internal_logon" property. Something like the following:
Properties props = new Properties();
props.put("user", "scott");
props.put("password", "tiger");
props.put("internal_logon", "sysoper");
Connection conn = DriverManager.getConnection (url, props);
When connecting as SYSDBA or SYSOPER using the Thin driver, the RDBMS must be configured to use a password file. See "Creating and Maintaining a Password File" in the "Oracle Database Administrator's Guide".
So, i did execute orapwd command to create a password file and also set remote_login_passwordfile=execlusive in my initxxx.ora initial parameter file, however, when i tried to connect, it failed.
private static void createEmsdbDatabase(){
String url = "jdbc:oracle:thin:@localhost:1521:";
StringBuffer sqlStatement = new StringBuffer();
sqlStatement.append("create database xxx");
sqlStatement.append("maxdatafiles 254 ");
sqlStatement.append("maxinstances 8 ");
sqlStatement.append("maxlogfiles 32 ");
sqlStatement.append("character set UTF8 ");
sqlStatement.append("national character set UTF8 ");
sqlStatement.append("DATAFILE 'c:\\oracle\\xxx\\system01.dbf' SIZE 18M REUSE ");
sqlStatement.append("logfile 'c:\\oracle\\xxx\\redo01.log' SIZE 2M REUSE, ");
sqlStatement.append("'c:\\oracle\\xxx\\redo02.log' SIZE 2M REUSE, ");
sqlStatement.append("'c:\\oracle\\xxx\\redo03.log' SIZE 2M REUSE ");
try {
DriverManager.registerDriver(new OracleDriver());
Properties props = new Properties();
props.put("user", "sys");
props.put("password", "password");
props.put("database","xxx");
props.put("internal_logon", "sysdba");
Connection conn = DriverManager.getConnection(url, props);
Statement statement = conn.createStatement();
statement.executeUpdate(sqlStatement.toString());
statement.close();
conn.close();
} catch (SQLException e) {
e.printStackTrace();
But what made me puzzled a lot is if i use OCI driver, it did work great, why??? guys, anybody knows, please give me some tips, thanks in advance.
regards,
Kaixuan @ Shanghai

clarify my question in detail:
Step 1 : create password file using orapwd command
Step 2 : create database instance using oradim command
Step 3 : login using sys as sysdba to startup database, e.g startup nomount pfile='...\initxxx.ora'
Step 4 : create database.
java code showing below:
private static void createEmsdbDatabase(){
String url = "jdbc:oracle:thin:@localhost:1521:";
StringBuffer sqlStatement = new StringBuffer();
sqlStatement.append("create database xxx ");
sqlStatement.append("maxdatafiles 254 ");
sqlStatement.append("maxinstances 8 ");
sqlStatement.append("maxlogfiles 32 ");
sqlStatement.append("character set UTF8 ");
sqlStatement.append("national character set UTF8 ");
sqlStatement.append("DATAFILE 'c:\\oracle\\xxx\\system01.dbf' SIZE 18M REUSE ");
sqlStatement.append("logfile 'c:\\oracle\\xxx\\redo01.log' SIZE 2M REUSE, ");
sqlStatement.append("'c:\\oracle\\xxx\\redo02.log' SIZE 2M REUSE, ");
sqlStatement.append("'c:\\oracle\\xxx\\redo03.log' SIZE 2M REUSE ");
try {
DriverManager.registerDriver(new OracleDriver());
Properties props = new Properties();
props.put("user", "sys");
props.put("password", "password");
props.put("database","xxx");
props.put("internal_logon", "sysdba");
Connection conn = DriverManager.getConnection(url, props);
Statement statement = conn.createStatement();
statement.executeUpdate(sqlStatement.toString());
statement.close();
conn.close();
} catch (SQLException e) {
e.printStackTrace();
issue was met here, when i tried to login as sysdba using sys, and in my java code, i use Thin driver, it then thrus exception, but when OCI driver is used, it works great, i don't know why.
that is, when i use "jdbc:oracle:oci8:@" as database URL and then properties.put("database","xxx"), it works great. but, when i use "jdbc:oracle:thin:@localhost:1521:" as database URL and then properties.put("database","xxx"), it failed. hopefully, i have clarified my question clearly. thanks.

Similar Messages

  • How to use the oracle jdbc driver

    hi all,
    i have use the jdbc driver for oracle before but this time i<m under a hp-ux system and it seems to be different
    the dba here said the odbc driver and the jdbc driver where install but i get this error when i compile the code
    Class oracle.jdbc.driver.OracleDriver not found in type declration.
    if i try to use a odbc driver i can compile(since the classes are in jdk1.3) but i get this error at run time
    java.sql.SQLException: No suitable driver
    at java.sql.DriverManager.getConnection(Compiled Code)
    at java.sql.DriverManager.getConnection(DriverManager.java:126)
    at TestOracle.<init>(TestOracle.java:33)
    at TestOracle.main(TestOracle.java:126)
    can someone help me out to better understand what is wrong
    it seems the drivers are not install but again the dba assures me they are
    import java.sql.*;
    import java.io.*;
    public class TestOracle {
    public TestOracle()
    // Load the Oracle JDBC driver
    // Connect to the database
    // search the dossiers numbers in the right table depending on criteria
    // if demands comes from extranet verify to only send back the dossier
    // numbers that are linked to the customer
    // Load the Oracle JDBC driver
    try
         //DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
         //Class.forName("oracle.djbc.driver.OracleDriver");
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    catch( Throwable t ){t.printStackTrace();}
    //SQLException,IOException,ClassNotFoundException,
    //IllegalAccessException,InstantiationException
    try
         // Connect to the database
         // You can put a database name after the @ sign in the connection URL.
         Connection conn =
              //DriverManager.getConnection ("jdbc:oracle:oci8:@COLDDEV", "USER", "PPP");
              DriverManager.getConnection("jdbc:odbc:COLDDEV","USER", "PPP");
         Statement stmt = conn.createStatement ();
         ResultSet r = stmt.executeQuery("select * from Dossier");
         stmt.close();
         System.out.println("trouver:" + r.getString("Dossier_Number"));
    catch (SQLException e){e.printStackTrace();}
    public static void main(String[] args)
    TestOracle testOracle1 = new TestOracle();
    here is the code iuse

    http://forum.java.sun.com/thread.jsp?forum=48&thread=187964&start=0&range=15#608968
    The above link is a comprehensive "How to get set up and on my way" that I made for someone else learning Oracle/jdbc. Kind of a self-help resource page. I would start from the beginning and download the newest drivers, then set up your environment,...etc.
    hope this helped,
    Jamie

  • Use of oracle.jdbc.driver now deprecated.

    Hi all,
    Just thought of sharing this note with us.,(if its new ..)
    http://otn.oracle.com/docs/products/oracle9i/doc_library/901_doc/java.901/a90211/overvw.htm#1008871
    Extract ...,
    Beginning in Oracle9i, the Oracle extensions to JDBC are captured in the package oracle.jdbc. This package contains classes and interfaces that specify the
    Oracle extensions in a manner similar to the way the classes and interfaces in java.sql specify the public JDBC API.
    Your code should use the package oracle.jdbc instead of the package oracle.jdbc.driver used in earlier versions of Oracle. Use of the package
    oracle.jdbc.driver is now deprecated, but will continue to be supported for backwards compatibility.
    All that is required to covert your code is to replace "oracle.jdbc.driver" with "oracle.jdbc" in the source and recompile. This cannot be done piece-wise.
    You must convert all classes and interfaces that are referenced by an application. Conversion is not required, but is highly recommended. Future releases of Oracle
    may have features that are incompatible with use of the package oracle.jdbc.driver.
    The purpose of this change is to enable the Oracle JDBC drivers to have multiple implementations. In all releases up to and including Oracle9i, all of the Oracle
    JDBC drivers have used the same top level implementation classes, the classes in the package oracle.jdbc.driver. By converting your code to use
    oracle.jdbc, you will be able to take advantage of future enhancements that use different implementation classes. There are no such enhancements in Oracle9i, but
    there are plans for such enhancements in the future.
    Regards
    Elango.

    The two main things that would have to change
    - driver : com.microsoft.sqlserver.jdbc.SQLServerDriver
    - url: jdbc:microsoft:sqlserver://localhost:1433
    It may be that this page will help you
    http://msdn.microsoft.com/data/learning/jdbc/
    You also need to make sure that the files Msbase.jar , Msutil.jar and Mssqlserver.jar are all available in the "classpath"
    For a web app, that means these files should be in the WEB-INF/lib directory.
    Good luck,
    evnafets

  • Synonym use through Oracle JDBC driver

    I am trying to find out if Oracle JDBC driver can use synonym to get to an oracle object. I connect to one schema, this schema has synonym for this object and grant from other schema which is the owner of this object. Unless, I have this object's name prefixed with the schema name (which is the owner of this object) JDBC driver cannot see it. We move around oracle types(objects) to different schema for house keeping and this make our java code fail. I am trying to find out a way to remove this dependency of tacking schema name front of object name. Can you please let me know that if this is Oracle JDBC diver limitation or I should be something else?

    http://forum.java.sun.com/thread.jsp?forum=48&thread=187964&start=0&range=15#608968
    The above link is a comprehensive "How to get set up and on my way" that I made for someone else learning Oracle/jdbc. Kind of a self-help resource page. I would start from the beginning and download the newest drivers, then set up your environment,...etc.
    hope this helped,
    Jamie

  • [Oracle JDBC Driver]This driver is locked for use with embedded application

    Hi
    I installed Sun Java Studio Enterprise 8, and am trying to connect to my Oracle database using the attached tutorial code.
    The code compiles fine, but I get the following error whenever I run the file: [Oracle JDBC Driver]This driver is locked for use with embedded application
    I don't understand what is happening.
    Using the Runtime navigation panel on the upper left of the IDE screen, I can right-click and connect to the database, and navigate database files, using the Oracle JDBC Driver that came with JSE8.
    Name: Oracle Driver
    Driver: com.sun.sql.jdbc.oracle.OracleDriver
    Database URL: jdbc:sun:oracle://JAZZPUP:1521;SID=REPO
    If the driver is installed, and can be used to connect to a database by right-clicking on the database definition in the Runtime panel, why can't I connect to it just using java code in the IDE. I would expect both methods to work or to fail, not one of each using the same IDE.
    Many thanks and take care,
    Shayne
    import java.sql.*;
    public class CreateCoffees {
    public static void main(String args[]) {
    //String url = "jdbc:mySubprotocol:myDataSource";
    String url = "jdbc:sun:oracle://JAZZPUP:1521;SID=REPO";
    Connection con;
    String createString;
    createString = "create table COFFEES " +
    "(COF_NAME VARCHAR(32), " +
    "SUP_ID INTEGER, " +
    "PRICE FLOAT, " +
    "SALES INTEGER, " +
    "TOTAL INTEGER)";
    Statement stmt;
    try {
    //Class.forName("myDriver.ClassName");
    Class.forName("com.sun.sql.jdbc.oracle.OracleDriver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    //con = DriverManager.getConnection(url, "myLogin", "myPassword");
    con = DriverManager.getConnection(url, "login", "password");
    stmt = con.createStatement();
    stmt.executeUpdate(createString);
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.println("SQLException: " + ex.getMessage());
    } //end class CreateCoffees
    ---

    There are two similar threads:
    http://swforum.sun.com/jive/thread.jspa?threadID=61327&tstart=0
    http://swforum.sun.com/jive/thread.jspa?threadID=51057&messageID=188210
    To summarize - the DataDirectDriver that is shipped with the IDE seems to be locked to be used inside the IDE only because of some licensing issues etc..
    That's weird, I agree. I will raise a question on reasons for such a behavior.
    The solution would be to use Oracle's own driver, that is distributed at no charge from their web site - http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
    HTH,
    Kirill

  • Problems when using absolute() on Oracle JDBC driver

    Hi all,
    I wrote some codes using JDBC to access a remote Oracle server. After got the resultset, I attempted to use absolute() method to move to a specific row index and got an error. Could anyone please help me to find out the cause and the solution?
    Thanks in advanced,
    ** We have used driver package jdbc/lib/classes.zip in ORACLE 8.1.7
    ** The total of records in HEFKE000 table > 1000;
    ** The coding is following:
    String url = null;
    Connection conn = null;
    ResultSet rs = null;
    Statement stmt = null;
    String query = "select * from HEFKE000";
    String dbName = "HE_MI";
    String hostName = "NTTD";
    String userName = "HOKEN";
    String passWord = "manager";
    String dbDriver = "oracle.jdbc.driver.OracleDriver";
    //Load the Driver
    Class.forName(dbDriver);
    //get connection
    url = "jdbc:oracle:oci8:@NTTD";     
    //url = "jdbc:oracle:thin:@" + hostName + ":1521:" + dbName;
    conn = DriverManager.getConnection (url, userName, passWord);
    // It's faster when you don't commit automatically
    conn.setAutoCommit (false);
    // Create a Statement object so we can submit
    // SQL statements to the driver
    stmt = conn.createStatement();
    // Submit a query, creating a ResultSet object
    rs = stmt.executeQuery(query);
    // Get the ResultSetMetaData. This will be used for the column headings
    ResultSetMetaData rsmd = rs.getMetaData ();
    // Get the number of columns in the result set
    int numCols = rsmd.getColumnCount ();
    int i;
    if (rs.next() == rs.isFirst()) {
    rs.absolute(100);
    boolean more = rs.next ();
    while (more) {
    // Loop through each column, getting the
    // column data and displaying
    for (i=1; i<=numCols; i++) {
    if (i > 1) {
    System.out.print("|");
    if (rs.getString(i) == null)
    System.out.print("");
    else
         System.out.print(rs.getString(i));
    output.println();
    // Fetch the next result set row
    more = rs.next ();
    ** The error:
    Exception in thread "main" java.sql.SQLException: Invalid operation for forward
    only resultset : absolute

    Thanks. However, after changed the codes as your suggestion and ran again, I got the following error:
    Exception:
    java.lang.OutOfMemoryError
    <<no stack trace available>>
    A note is that, the 'select * from HEFKE000' statement would get around 1,5 millions of records. So, the 'out of memory' above is for client side or for server side?
    Thanks,

  • Error oracle.sql.* and oracle.jdbc.driver.* not found when using oracle as a database

    I am using oracle as database and weblogic 4.5. I have copied the classes12.zip file in lib directory of weblogic. I am getting the error that oracle.sql.* and oracle.jdbc.driver.* not found when i am importing these packages in a jsp file. what i need to do to import oracle driver packages?I put it in the classpath also.
    Please Advice!
    Thanks in advance
    AnuPama

    Hi Anupama,
    First of all I would be surprised if you would not like to use the connection pooling feature of weblogic (in which case you might not be needing the import the classes directly), and would like to open direct connections to your database. Anyways for doing that I would recommend you to check out the readme doc that ships
    along with the jdbc oracle (classes12.zip etc). I am giving an excerpt over here:
    These are a few simple things that you should do in your JDBC program:
    1. Import the necessary JDBC classes in your programs that use JDBC.
    For example:
    import java.sql.*;
    import java.math.*;
    2. Register the Oracle driver before before calling other JDBC APIs.
    (This is not needed if you are using the JDBC Server-side Internal
    Driver because registration is done automatically in the server.)
    To register the Oracle driver, make sure the following statement
    is executed at least once in your Java session:
    DriverManager.registerDriver(
    new oracle.jdbc.driver.OracleDriver());
    3. Open a connection to the database with the getConnection call.
    Different connection URLs should be used for different JDBC
    drivers. The following examples demonstrate the different URLs.
    For the JDBC OCI8 Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:oci8:@<database>",
    "scott", "tiger");
    where <database> is either an entry in tnsnames.ora or a SQL*net
    name-value pair.
    For the JDBC Thin Driver, or Server-side Thin Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:thin:@<database>",
    "scott", "tiger");
    where <database> is either a string of the form
    <host>:<port>:<sid> or a SQL*net name-value pair.
    For the JDBC Server-side Internal Driver:
    Connection conn = DriverManager.getConnection(
    "jdbc:oracle:kprb:");
    Note that the trailing ':' character is necessary. When you use
    the Server-side Internal Driver, you always connect to the
    database you are executing in. You can also do this:
    Connection conn
    = new oracle.jdbc.driver.OracleDriver().defaultConnection();
    Hope this helps,
    Thanks,
    Anupama wrote:
    I am using oracle as database and weblogic 4.5. I have copied the classes12.zip file in lib directory of weblogic. I am getting the error that oracle.sql.* and oracle.jdbc.driver.* not found when i am importing these packages in a jsp file. what i need to do to import oracle driver packages?I put it in the classpath also.
    Please Advice!
    Thanks in advance
    AnuPama--
    Apurb Kumar

  • Receiving oracle.jdbc.driver error when trying to connect

    Setup:
    Windows 7 64bit
    4GB ram
    SQL Developer 3.2.20.09
    Java platform 1.6.0_37
    Oracle IDE 3.2.20.09.87
    Hello, I'm going to start by saying I'm a rank amateur when it comes to using and understand SQL developer. My entire need for this program is to connect to a virt server at my office and test out my SQL queries against our tables. It's been working great for this purpose until yesterday when I received this error:
    An error was encountered performing the requested operation:
    oracle.jdbc.driver.T2CConnection.getLibraryVersionNumber()I
    Vendor code 0
    I did some searching and found a few references to this error but due to my inexperience I was unable to follow the resolutions and fix the error. This connection was working fine until yesterday afternoon which seemed odd. Based on my control panel, here is what I installed yesterday, I believe I installed both Java's after the error occurred seeing if they would alleviate the issue.
    MySQL Administrator 1.1
    Java SE Development Kit 6 Update 41 (64-bit)
    MySQL Workbench 5.2 CE
    Java 6 Update 41 (64-bit)
    Could one of these be the root of the issue?
    Thanks for the help and sorry for the lack of technical expertise, my need is very narrow and up until now this program has worked great for me.
    -Brad
    Edited by: 998110 on Apr 4, 2013 9:46 AM

    >
    Could one of these be the root of the issue?
    >
    More likely to be that you are now using the wrong version of the oracle jdbc jar file.
    Post the name and version of the JDBC jar file that you think you are using.
    Search the pc for ALL such files.
    Examine the environment variables (e.g. PATH) to see if they reference jdbc jars other than the ojdbc6 jar you should be using.

  • How can i use the weblogic jdbc driver for sqlserver?

    hello
    i have downloaded and installed the weblogic on my windows2000 server,then i want to use the weblogic jdbc driver for sqlserver2000 outside of the weblogic,as follow:
    1 add following string to my classpath environment of the wndows2000: E:\bea\wlserver6.1\lib\mssqlserver4v65.jar
    2 then i write a test program as:
    import weblogic.jdbc.mssqlserver4.Driver;
    import java.sql.*;
    public class test{
    public static void main(String argv[]){
    try{ Class.forName("weblogic.jdbc.mssqlserver4.Driver");
    Connection
    conn=DriverManager.getConnection"jdbc:weblogic:mssqlserver4:localhost:1433","sa",""); }catch(Exception e){ System.out.println(e.getMessage()); }
    4 when i execute it,it throw a exception:
    Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/version at weblogic.jdbc.mssqlserver4.TdsStatement.getLicenseStr(TdsStatement.java:2665) at weblogic.jdbc.mssqlserver4.TdsStatement.microsoftLogin(TdsStatement.java:2474) at weblogic.jdbc.mssqlserver4.MicrosoftConnection.beginLogin(MicrosoftConnection.java:42) at weblogic.jdbc.mssqlserver4.TdsConnection.login(TdsConnection.java:57) at weblogic.jdbc.mssqlserver4.MicrosoftConnection.login(MicrosoftConnection.java:53) at weblogic.jdbc.mssqlserver4.BaseConnection.prepareConnection(BaseConnection.java:187) at weblogic.jdbc.mssqlserver4.Driver.newConnection(Driver.java:34) at weblogic.jdbc.mssqlserver4.ConnectDriver.connect(ConnectDriver.java:151) at java.sql.DriverManager.getConnection(DriverManager.java:517) at java.sql.DriverManager.getConnection(DriverManager.java:177) at test.main(test.java:7)
    who can help me?thank you!

    Hi,
    Mail me the jar file as I am using Weblogic 6.1 to my email id [email protected]
    Else tell me the site from where u have downloaded and i will do the same.
    I will test the same and let you know.
    Thanks,
    Seetesh

  • Class Not found : oracle.jdbc.driver.OracleDriver when calling web service

    Hi,
    I have installed the Oracle Data Integrator Public Web Services on Apache Tomcat 5.5 application server with Apache Axis2
    When I try to call the web service OdiInvoke using the operation "listScenario" using only the JdbcDriver as input parameter, the response I get back from the web service call is:
    java.lang.ClassNotFoundException: Class Not found : oracle.jdbc.driver.OracleDriver
    Using the operator "getWebServiceVersion" I get a successfull response back som the connection seems fine.
    Obviously the error has to do with the driver not beeing available but where should I put the driver? Or how do I make it available? When working from Topology Manager, all connections are fine.
    Best regards
    M

    Solved it on my own by putting ojdbc14.jar in the following directory: <Apache-Tomcat install dir>/webapps/axis2/WEB-INF/lib/
    Thought I'd share in case some one else has same issue
    /M

  • Load oracle jdbc driver error when run applet via the web

    Hi All,
    I have built an applet which connect to database via jdbc thin driver. It works fine when I run it through the applet viewer, but got a problem when run it through the web.
    java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
    I am using jdev9i 9.0.4 and jdk 1.4.2. The jdbc version is 9.0.1
    I have added both the classes12.zip and ojdbc14.zip in the class path and also pack them together with my applet class. Here is the code
    public class MyApplet extends Applet
    implements Runnable
    public void start()
    if(theThread == null)
    theThread = new Thread(this);
    theThread.start();
    Retrieve R = new Retrieve();
    this.MyMap = R.retrieveDesc();
    public class Retrieve
    public Retrieve()
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn=DriverManager.getConnection("jdbc:oracle:thin:@babyruth.wvu.edu:1703:devdw", User, Password);
    conn.setAutoCommit(true);
    connectStatus = true;
    public HashMap retrieveDesc()
    return map;
    I have also built one HTML page NewApplet like this
    <HTML>
    <HEAD>
    <TITLE> My New Applet</TITLE>
    </HEAD>
    <APPLET CODE="MyApplet.class" CODEBASE="menu" ARCHIVE="MyApplet.zip" WIDTH=300 HEIGHT=485>
    <!--General Settings-->
    <param name="bgcolor" value="255,255,255">
    </HTML>
    Any advice is highly appreciated
    Mei

    Sir,
    Well you haven't "packed" them correctly. Why don't you just add the driver bits to the soucebase tag? or something like that anyway...
    Sincerely,
    Slappy

  • Not able to work with multiple Databases using  oracle.jdbc.driver.OracleDr

    Hi all,
    I am using the following Oracle Driver in Weblogic 6.1 sp 4
    oracle.jdbc.driver.OracleDriver / jdbc:oracle:thin:
    Driver. I am not able to select rows from two different table, which resides in two different Databases.
    The Exception is :
    SQL Exception Connection has already been created in this tx context for pool named CDPool. Illegal attempt to create connection
    nother pool: MultiTransactionTest
    Start server side stack trace:
    java.sql.SQLException: Connection has already been created in this tx context for pool named CDPool. Illegal attempt to create c
    on from another pool: MultiTransactionTest
    at weblogic.jdbc.jts.Driver.getExistingConnection(Driver.java:288)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:123)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:214)
    at weblogic.jdbc.common.internal.RmiDataSource_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    End server side stack trace
    Can any one help me to fix this issue?
    -Thanks & Regards,
    Shamil.S

    Shamil S wrote:
    Hi all,
    I am using the following Oracle Driver in Weblogic 6.1 sp 4
    oracle.jdbc.driver.OracleDriver / jdbc:oracle:thin:
    Driver. I am not able to select rows from two different table, which resides in two different Databases.
    The Exception is :
    SQL Exception Connection has already been created in this tx context for pool named CDPool. Illegal attempt to create connection
    nother pool: MultiTransactionTestHi. You can't domultiple DBMSes in one transaction unless you use an XA driver and
    an XA transaction. Your workarounds are:
    1 - Use an XA driver, datasource, and tx
    2 - If you're just reading, you can use non-transactional datasources. Do make sure you
    always close your connections...
    Joe
    >
    Start server side stack trace:
    java.sql.SQLException: Connection has already been created in this tx context for pool named CDPool. Illegal attempt to create c
    on from another pool: MultiTransactionTest
    at weblogic.jdbc.jts.Driver.getExistingConnection(Driver.java:288)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:123)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:214)
    at weblogic.jdbc.common.internal.RmiDataSource_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
    at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
    at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    End server side stack trace
    Can any one help me to fix this issue?
    -Thanks & Regards,
    Shamil.S

  • How to use the latest jdbc driver in weblogic61beta?

    weblogic61 comes with mssqlserver4v65.jar,
    currently the latest jdbc driver is mssqlserver4v70sp10
    but seems the license and directory structure is only for
    weblogic51. I tried to use it for weblogic61beta, but it failed.
    please advice. thanks

    here's the stack trace when I tried to use the latest jdbc driver
    other than the one comes with weblogic61beta
    The WebLogic Server did not start up properly.
    Exception raised: java.lang.NoSuchMethodError
    java.lang.NoSuchMethodError
    at weblogic.management.internal.xml.ConfigurationParser$ConfigurationHandler.parseMBeanAttri
    butes(ConfigurationParser.java:300)
    at weblogic.management.internal.xml.ConfigurationParser$ConfigurationHandler.startElement(Co
    nfigurationParser.java:185)
    at weblogic.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1340)
    at weblogic.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:
    1183)
    at weblogic.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1
    862)
    at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumen
    tScanner.java:1005)
    at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381
    at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:967)
    at weblogic.management.internal.xml.ConfigurationParser.parse(ConfigurationParser.java:104)
    at weblogic.management.internal.xml.XmlFileRepository.loadDomain(XmlFileRepository.java:261)
    at weblogic.management.internal.xml.XmlFileRepository.loadDomain(XmlFileRepository.java:223)
    at java.lang.reflect.Method.invoke(Native Method)
    at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:587)
    at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
    at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:31
    9)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
    at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
    at $Proxy1.loadDomain(Unknown Source)
    at weblogic.management.AdminServer.configureFromRepository(AdminServer.java:186)
    at weblogic.management.AdminServer.configure(AdminServer.java:171)
    at weblogic.management.Admin.initialize(Admin.java:229)
    at weblogic.t3.srvr.T3Srvr.initialize(T3Srvr.java:354)
    at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:197)
    at weblogic.Server.main(Server.java:35)
    Reason: Fatal initialization exception
    "Jason Chen" <[email protected]> wrote:
    >
    weblogic61 comes with mssqlserver4v65.jar,
    currently the latest jdbc driver is mssqlserver4v70sp10
    but seems the license and directory structure is only for
    weblogic51. I tried to use it for weblogic61beta, but it failed.
    please advice. thanks

  • How to avoid oracle.jdbc.driver.OracleConnection using

    i'am new in Java but recently i've got a project on support.
    Problem:
    solution worked on jvm 1.4, now on 1.7.
    Respectively, class oracle.jdbc.driver.OracleConnection has been used.
    Now I need class oracle.jdbc.OracleConnection to use CLOB.createTemporary() but...I can't.
    According to the docs, it's enough to replace in code and config files one class declaration on another. But NO. I replaced all of them in all config files and anyway, there was only oracle.jdbc.driver.OracleConnection has been created. (there is no explicit declaration of connection type in code, everything is configured in config files)
    Project uses marven, mybatis-3.1.1. Database: oracle 9
    Driver: ojdbc14-9.2.0.5.jar contains both classes: both oracle.jdbc.driver.OracleConnection (for backward compatibility) and oracle.jdbc.OracleConnection.
    The matter is what should i do to use second one instead of first one.
    May be there is some java cache? I do not know...
    Anybody knows?

    Now I need class oracle.jdbc.OracleConnection to use CLOB.createTemporary() but...I can't.
    Why not? You have to explain, in detail, WHAT you are trying and WHY you say you "can't" do it.
    According to the docs, it's enough to replace in code and config files one class declaration on another.
    That is correct - this IS all that is required. Replace ALL references to 'oracle.jdbc.driver' in your code.
    But NO. I replaced all of them in all config files and anyway, there was only oracle.jdbc.driver.OracleConnection has been created. (there is no explicit declaration of connection type in code, everything is configured in config files)
    We can't SEE what 'config' information you say you changed. It is what is in the CODE that matters, not what is in a config file.
    If the 'oracle.jdbc.driver' package is being imported by your code and a reference to 'Connection' is made Java will use it from the first package that it finds the class in.
    You are using an ANCIENT jdbc jar file. That doc you linked to WARNS you that you should upgrade and that doc is over ten years old.
    Remove that old jdbc jar file and use the current driver. Also remove references to the old package and replace them with references to the new package.
    With code and jars that are that old you can expect to have problems trying to use additional features, especially extensions. I would be surprised if you didn't have other issues as well.
    You need to perform code review to find all of the references that need to be corrected.

  • Bug in Oracle JDBC Driver: NullPointerException when calling clearParameters

    There is a bug in the latest version of the JDBC driver that throws a NPE when calling PreparedStatement.clearParameters(). I don't need a response to this, since I have a workaround (just catching and ignoring the exception), but it should probably be fixed. I speculate that the problem only occurs when you try to call clearParameters() more than once on the same PS, but I haven't confirmed it.
    It is probably an easy fix. Following is the stack trace:
    java.lang.NullPointerException
    at oracle.jdbc.dbaccess.DBData.clearItem(DBData.java:431)
    at oracle.jdbc.dbaccess.DBDataSetImpl.clearItem(DBDataSetImpl.java:3528)
    at oracle.jdbc.driver.OraclePreparedStatement.clearParameters(OraclePreparedStatement.java:3401)
    at com.solarmetric.datasource.PreparedStatementCache$CachePreparedStatement.close(PreparedStatementCache.java:293)
    at com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatementBatch(SQLExecutionManagerImpl.java:666)
    at com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatement(SQLExecutionManagerImpl.java:514)
    at com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeInternal(SQLExecutionManagerImpl.java:406)
    at com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.flush(SQLExecutionManagerImpl.java:273)
    at com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:421)
    at com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:549)
    at com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:412)
    at com.sun.jdotck.api.persistencemanager.MakePersistentAssignsObjectId.testMakePersistentAssignsObjectId2(Unknown Source)
    at com.sun.jdotck.api.persistencemanager.MakePersistentAssignsObjectId.testMakePersistentAssignsObjectId(Unknown Source)
    at com.sun.jdotck.api.persistencemanager.MakePersistentAssignsObjectId.runTest(Unknown Source)
    at com.sun.jdotck.api.persistencemanager.PersistenceManagerTest.run(Unknown Source)
    at com.solarmetric.kodo.compatibility.JDOCompatabilityTestSuite$1.runTest(JDOCompatabilityTestSuite.java:493)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:325)
    at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:524)
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

    Take a look at the method that is causing the NullPointerException:
    public void clearItem(int i)
    if (!m_dynamic && m_vector == null && i < m_vector.size())
    m_vector.removeElementAt(i);
    if (m_items != null && i >= m_items.length)
    return;
    m_items[i] = null;
    return;
    A NullPointerException will be thrown whenever clearParameters() is called when no parameters have yet been bound.
    The first IF statement should read:
    if (!m_dynamic && m_vector != null && i < m_vector.size())
    A simple workaround would be to make sure that your parameter list is never empty before calling clearParameters(). Is there a patch for this anywhere?

Maybe you are looking for

  • Unable to use "drag and drop function" from outlook

    We are changing from Lotus to outlook and this has made a problem with getting pdf-files into OAWD directly . Procedure was like this in Lotus 1. We get documents (FI, F-43, aso ) by email 2. We use OAWD function "drag and drop" , document is attache

  • Some problems with Oracle and XA in WLS 6.1

    Hi, I am using WLS6.1 SP4 with Oracle Thin driver 8.1.7 and TxDataSources with ConnectionPools using XA. I am getting the following error: java.sql.SQLException: ORA-00604: error producido a nivel 1 de SQL recursivo ORA-01000: número máximo de cursor

  • ORDER BY values in array

    Hello dear colleagues, Is it possible to sort values by values in IN clause. In MySQL there is a function called FIELD (http://stackoverflow.com/questions/866465/sql-order-by-the-in-value-list) For example: SELECT * FROM <tab> WHERE "attribute" IN ('

  • Embed test throwing ORA-00604 and ORA- 12705 errors

    Hi, I've setup a JEE application and when tried to make a connection the IDE was throwing errors ORA-00604: error occurred at recursive SQL level 1 ORA- 12705: invalid or unknown NLS parameter value specified That I fixed adding two entrances in the

  • Adjusting image in Aperture for Apple TV (16:9)

    I create an album from original master photos. I cropped them in 16:9 and syncronize them via iTunes to Apple TV. They not appear in Apple TV. Which is the correct method to do that ? I'd like not duplicate original master to save disk space.