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

Similar Messages

  • 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.

  • 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

  • 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

  • Oracle JDBC Driver 10.1.0.4.0 and IndexOutOfBounds-Exception

    Hello all,
    we´ve experienced a weird problem using the Oracle JDBC driver version 10.1.0.4.0. While executing SELECT statement we get an ArrayIndexOutOfBounds exception from the JDBC driver. Here´s the stacktrace:
    java.lang.ArrayIndexOutOfBoundsException
    at java.lang.System.arraycopy(Native Method)
    at oracle.jdbc.driver.T4CDateAccessor.saveDataFromOldDefineBuffers(T4CDateAccessor.java:212)
    at oracle.jdbc.driver.T4CPreparedStatement.saveDefineBuffersIfRequired(T4CPreparedStatement.java:405)
    at oracle.jdbc.driver.OracleStatement.prepareAccessors(OracleStatement.java:859)
    at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:949)
    at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:532)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1037)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2905)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2946)
    at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:124)
    We couldn´t find anything on the web on this error. We´re using Weblogic 8.1 SP4 with JDBC version. Does anyone have a hint or an idea what could be the problem here?
    Thanks for any help in advance!
    Cheers,
    Joerg

    I may have a related bug, I get a similiar exception when running JIRA...
    java.lang.ArrayIndexOutOfBoundsException: -1
    at oracle.jdbc.driver.DateTimeCommonAccessor.computeJulianDay(DateTimeCommonAccessor.java:341)
    at oracle.jdbc.driver.DateTimeCommonAccessor.getMillis(DateTimeCommonAccessor.java:386)
    at oracle.jdbc.driver.DateAccessor.getTimestamp(DateAccessor.java:142)
    at oracle.jdbc.driver.OracleResultSetImpl.getTimestamp(OracleResultSetImpl.java:1018)...I tried the 10.1.0.2 and 10.1.0.4 drivers, both throw the same exception. I would try the 10.2 drivers, but they just hang! Gotta love Oracle QA!

  • In Trouble with the Oracle JDBC Driver version - 10.1.0.5.0

    Hi !
    Without any problems i'm using the Oracle JDBC Driver version - 10.1.0.3.0 to access to the
    Oracle database (Oracle Database 10g Release 10.2.0.1.0 - 64bit Production).
    But exchanging the JDBC Driver 10.1.0.3.0 to 10.1.0.5.0 brings up the following problem:
    the statement
         con.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability)
         (with parameters resultSetType = 1003, resultSetConcurrency = 1007, resultSetHoldability= 1)
    returns null !
    while using the Oracle JDBC Driver version - 10.1.0.3.0 the statement (with same parameters)
    returns a correct PreparedStatement.
    Every hint or idea is welcome.
    Best regards,
    Claus

    Duplicate post:
    In Trouble with the Oracle JDBC Driver version - 10.1.0.5.0
    Claus,
    Pardon me if I am stating the obvious, but why don't you use the 10.2 JDBC driver with your 10.2 database? The driver is part of the database distribution. Otherwise, you can download the driver from the OTN Web site.
    Good Luck,
    Avi.

  • Oracle jdbc driver class and classes12.jar whether deprecated.?

    Hi All,
    1. In one of the post, it has been told that oracle.jdbc.driver.OracleDriver will be deprecated and also recommended to used oracle.jdbc.OracleDriver.
    According to that post, I changed the driver class name in my code as below:
    Class.forName("oracle.jdbc.OracleDriver");
    Then to check the driver name, I insert the below code:
    Enumeration<Driver> driverEnum = DriverManager.getDrivers();
    +while (driverEnum.hasMoreElements()){+
    System.out.println("driver : "driverEnum.nextElement());+
    +}+
    Below is the output:
    driver : oracle.jdbc.driver.OracleDriver@addbf1
    Even after specifying the driver class name to be used as oracle.jdbc.OracleDriver, why it is taking oracle.jdbc.driver.OracleDriver..?
    INFO : The Oracle JDBC Driver (classes12.jar) version is 10.2.0.4.0.
    2. We are using classes12.jar for developing all JDBC code. In Oracle Database 11g Release 2 (11.2.0.2.0) JDBC Drivers, there is no classes12.jar. Is this deprecated? Which jar can be used instead of classes12.jar?
    Thanks in advance.

    In Oracle Database 11g Release 2 (11.2.0.2.0) JDBC Drivers, there is no classes12.jar. Is this deprecated? Which jar can be used instead of classes12.jar?For JDBC 4.0 features ojdbc6.jar with JDK 6.0.
    For JDBC 3.0 support ojdbc 5.jar with JDK 5.0
    http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html

  • 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.

  • 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,

  • 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 Oracle jdbc driver fixedString property?

    Oracle pads values in char columns so if I insert "a" in a CHAR(2) column then I cannot get that record by comparing that column to "a", I should get it by comparing it to "a ". Right?
    To solve this problem the Oracle jdbc driver has the property fixedString but I cannot make it work. (look for fixedString here )
    I'm using ojdbc14.jar driver for Oracle 10gR2 and accessing an Oracle 10gR2 database.
    This is my code:
    try {
    Properties props = new Properties();
    props.put("user", "****");
    props.put("password", "****");
    props.put("fixedString", true);
    Class.forName("oracle.jdbc.driver.OracleDriver");
    String jdbcUrl = "jdbc:oracle:thin:@<host>:<port>:<sid>";
    Connection connection = DriverManager.getConnection(jdbcUrl, props);
    PreparedStatement ps = connection.prepareStatement(
    "SELECT * FROM MY_TABLE WHERE MY_TABLE_ID = ?");
    ps.setObject(1, "abc"); // (*)
    // MY_TABLE_ID is CHAR(15)
    ResultSet rs = ps.executeQuery();
    while (rs.next())
    System.out.print("data: ");
    System.out.println(rs.getString("MY_TABLE_ID"));
    rs.close();
    ps.close();
    connection.close();
    } catch (SQLException ex) {
    ex.printStackTrace();
    } catch (ClassNotFoundException ex) {
    ex.printStackTrace();
    The above code executes fine (no exceptions thrown) but the ResultSet is empty after executeQuery().
    If I change the line (*) for
    ps.setObject(1, "abc ");
    Then I get the column I wanted. So it seems the driver is ignoring the fixedString option.
    I've also tried changing the line (*) for
    ps.setObject(1, "abc", java.sql.Types.CHAR);
    But the ResultSet I get is empty again. What am I missing?
    Thanks in advance

    Es un Bug se corrige en la versión del OAS 10.1.2.3
    Bug 10222534: UNABLE TO SET FIXEDSTRING PROPERTY IN DATASOURCE

  • 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

  • Which Oracle JDBC Driver to use with WSAD 5.1.2?

    Hi,
    I will appreciate if someone could help me with:
    1) Whether I should select "Oracle JDBC Driver" or "Oracle JDBC Driver (XA)" as the JDBC Provider Type. The rest in the list (Thin & oci8 ) are deprecated.
    2) When I go to create a datasource, for either of the above JDBC provider type, I get the options:
    - User defined JDBC provider
    - Oracle JDBC provider
    - Oracle JDBC Thin Driver
    - Oracle JDBC oci8 Driver
    Why do I have the Thin and Oci8 option here, when those were shown as deprecated under JDBC Provider Type?
    Please help to clear up this confusion.
    -Nimmi

    This is what I did for my DS settings
    1. select Oracle JDBC Driver
    2. set Classes12.jar in Websphre classpath - (Oracle thin driver)
    3. create DS with option User defined JDBC provider
    means I have added Thin driver provided by Oracle , instead of deprecated Thin driver from IBM.

  • Problem using Oracle JDBC Driver

    Hi,
    I try to configure the Oracle JDBC Driver the following way:
    I load the Oracle drivers ojdbc14_g.jar and nls_charset12.jar
    I configure the DataSource using the Driver Class oracle.jdbc.driver.OracleDriver, the database URL: jdbc:oracle:thin:@h50a430:1521:WLP1E1A0 and the User with Password.
    As soon as its activated I get the following error:
    java.rmi.RemoteException: Error occurred while starting application in whole cluster and wait.; nested exception is:
         com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Complex error : server ID 4123350:Cannot start DataSource "Oracle".
         at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:678)
         at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:660)
         at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.startApplication(DataSourceManagerImpl.java:535)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
    any hint?

    I can't create an Oracle datasource too.
    Uploaded ojdbc14.jar, used the same Oracle jdbc settings as in my jdbc explorer where everything works fine, set initial connections to 1, set SQL Engine to Native SQL,...
    -> won't start.
    I restarted the cluster too. The Datasource is still marked with a red cross in the admin tool.
    This is with the type 1.x setting, as XA seems to be still broken in WAS 6.40.

Maybe you are looking for