Multithreaded clients and Oracle JDBC-drivers?

Are the thin and OCI8 drivers for Oracle multithreaded? (I know they're thread safe)
I.e. Can many threads share the same Connection object (and statement objects) to do their requests without the requests being serialized to the DB?
Sun's javadoc of package java.sql says:
We require that all operations on all the java.sql objects be multi-thread safe and able to cope correctly with having several threads simultaneously calling the same object.
Some drivers may allow more concurrent execution than others. Developers can assume fully concurrent execution; if the driver requires some form of synchronization, it will provide it. The only difference visible to the developer will be that applications will run with reduced concurrency.
For example, two Statements on the same Connection can be executed concurrently and their ResultSets can be processed concurrently (from the perspective of the developer). Some drivers will provide this full concurrency. Others may execute one statement and wait until it completes before sending the next.
One specific use of multi-threading is to cancel a long running statement. This is done by using one thread to execute the statement and another to cancel it with its Statement.cancel() method.
Restated again for Oracle; Will threads run concurrently when using the same connection and statements, or will the calls be serialized?

In the connection pool, I specified:
user
password
url
In the deployment tool (Sun Java Appl. Server 8 BE Update 1), I specified the "Resource Reference" for the EJB. This leads to the following entries in sun-ejb-jar.xml:
<res-ref-name>jdbc/pdisasdb</res-ref-name>        
   <jndi-name>jdbc/pdisasdb</jndi-name>        
      <default-resource-principal>         
         <name>myname</name>          
         <password>geheim</password>        
      </default-resource-principal> 
</resource-ref> The strange thing is, that now it works without this entry - but I am not gaga, yesterday it doesnt...

Similar Messages

  • Oracle JDBC Drivers 8.1.6.0.1

    In the readme file of Oracle JDBC drivers 8.1.6.0.1 (http://technet.oracle.com/software/tech/java/sqlj_jdbc/files/Readme_01.txt)
    it mentioned that it supports "connection pooling" and "distributed transactions".
    Later on in the same file under "Oracle JDBC Connection Caching", it says it "facilitates" users in their own connection pooling. Does this mean there is not complete implementation of connection pooling in the driver and users has to do the work themselves?
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JDBC_TX ():
    In the readme file of Oracle JDBC drivers 8.1.6.0.1 (http://technet.oracle.com/software/tech/java/sqlj_jdbc/files/Readme_01.txt)
    it mentioned that it supports "distributed transactions".
    As I understand, JDBC transaction is connection based and uses Oracle internal transaction manager. In order to do "distributed transactions", I must have at least two connections open at the same time each to its own database instance. How does the two connections coordinate the transactions? I thought in order to support "distributed transactions", one has to build a higher layer to encapsulate the two connections and therefore coordinate the distributed transactions. Any examples will be welcome.<HR></BLOCKQUOTE>
    The two branches of the transaction are coordinated using 2-phase commit.
    For samples look under
    $ORACLE_HOME/jdbc/demo/samples/oci8/jdbc20-samples/
    null

  • Is in ORACLE JDBC drivers connection pooling support

    Hi All!
    Can anybody give me information about subj?
    Any information appreciated

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Mike:
    Hi All!
    Can anybody give me information about subj?
    Any information appreciated<HR></BLOCKQUOTE>
    Yes, Oracle JDBC drivers do support connection pooling. Download the latest drivers to get samples and refer doc for more details.

  • 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

  • Using INET and DATADIRECT JDBC Drivers to connect MS SQL Server 2005

    Hi,
    I have reqmt to connect SQL server 2005 from ODI using INET and DATADIRECT JDBC drivers to test Local characters Encoding.
    In my case, Oracle is the Source and SQL Server 2005 is the Target. I have problem while interfacing Local Characters to SQL Server 2005 using com.microsoft.sqlserver.jdbc.SQLServerDriver driver( which is default driver provided by ODI). To fix local charatcters issue, I want to try using INET or DATADIRECT JDBC drivers. Please provide me the below of any one has used these Drivers to connect SQL Server 2005 from ODI.
    We are trying to connect to MS SQL Server 2005 from ODI Topology Mgr using INET and DATADIRECT JDBC Drivers. We need the following info to connect to the same,
    --> What are list of the drivers need to be placed in OraHome_1\oracledi\drivers path?
    --> Where can i get the latest driver versions.
    --> What are the JDBC DRIVER and URL formats.
    --> Any other additional configurations?
    --> Does these drivers support interfacing of Local character data.
    Please respond...
    Regards,
    Anil

    Check this article [HOW TO: SQL & JAVA|http://www.shahriarnk.com/Shahriar-N-K-Research-Embedding-SQL-in-C-Sharp-Java.html] for details on how to connect to SQL Server database from C#.NET database applications as well as Java database applications. It also describes how to pass embedded SQL queries (SELECT, INSERT, UPDATE, DELETE), calling stored procedures, pass parameters etc.

  • IE4 and Oracle JDBC

    Hi,
    I downloaded and installed Oracles JDBC drivers and tested
    them out using the sample programs that Oracle provided. Though
    the application I was able to connect and retrieve some rows
    without any problem. I then modefied the Java source for the
    applet and ran it through Sun's Appletviewer and was able to
    retrieve rows. I then tried to run the same applet through IE4
    and the applet started okay but I recieved the following:
    Loading JDBC driver oracle.jdbc.driver.OracleDriver
    Connecting to SMORA1
    cannot access "<This was my Oracle host name>"
    I'm running the applet of my PC and trying to connect to the
    Oracle host. I think I may of just answered my own question.
    But why would it work with Appletviewer??
    Thanks
    Dave
    null

    Dave:
    I am facing the same problem but not getting any answer. Could
    you let me know what solution did you implement to get it going.
    Thanks in advance,
    Raj.
    David Staelens (guest) wrote:
    : Hi,
    : I downloaded and installed Oracles JDBC drivers and tested
    : them out using the sample programs that Oracle provided.
    Though
    : the application I was able to connect and retrieve some rows
    : without any problem. I then modefied the Java source for the
    : applet and ran it through Sun's Appletviewer and was able to
    : retrieve rows. I then tried to run the same applet through
    IE4
    : and the applet started okay but I recieved the following:
    : Loading JDBC driver oracle.jdbc.driver.OracleDriver
    : Connecting to SMORA1
    : cannot access "<This was my Oracle host name>"
    : I'm running the applet of my PC and trying to connect to the
    : Oracle host. I think I may of just answered my own question.
    : But why would it work with Appletviewer??
    : Thanks
    : Dave
    null

  • Kodo 3.4.1 and Oracle JDBC 11.1.0.6?

    Hi,
    did anybody already try using Kodo 3.4.1 and Oracle JDBC driver 11.1.0.6?
    We have been able to use it by specifying:
    kodo.jdbc.DBDictionary=oracle(BatchLimit=1000)
    but it does not run very smoothly and we get for example the
    following exception (but not always).
    NestedThrowablesStackTrace:
    [migrate-data] java.lang.ArrayIndexOutOfBoundsException: -32193
    [migrate-data] at
    oracle.jdbc.driver.OraclePreparedStatement.setupBindBuffers(OraclePreparedS
    tatement.java:2677) [migrate-data] at
    oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedState
    ment.java:9270) [migrate-data] at
    oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapp
    er.java:210) [migrate-data] at
    com.solarmetric.jdbc.DelegatingPreparedStatement.executeBatch(DelegatingPre
    paredStatement.java:325) [migrate-data] at
    com.solarmetric.jdbc.PoolConnection$PoolPreparedStatement.executeBatch(Pool
    Connection.java:375) [migrate-data] at
    com.solarmetric.jdbc.DelegatingPreparedStatement.executeBatch(DelegatingPre
    paredStatement.java:325) [migrate-data] at
    com.solarmetric.jdbc.DelegatingPreparedStatement.executeBatch(DelegatingPre
    paredStatement.java:325) [migrate-data] at
    com.solarmetric.jdbc.DelegatingPreparedStatement.executeBatch(DelegatingPre
    paredStatement.java:325)Any hints?
    Thanks,
    Werner

    Disabling SQL batching by specifying BatchLimit = 0 solved the
    problem temporarlyOf course this is not what we want, anybody else using this configuration?
    Werner

  • DT require Oracle9i client and Oracle Services for MTS software

    "Distributed Transactions require Oracle9i client and Oracle Services for Microsoft Transaction Server software."
    I get the error above when attempt to run a COM+ transaction accessing Oracle9i. I'd been checked the installation of Oracle9i and Oracle Services in the client computer and it is ok.
    I am using Windows Server 2003 and the database server is on another Windows Server 2003. The database is Oracle9i Enterprise Edition.
    At Stanford's web site (http://www.stanford.edu/dept/itss/docs/oracle/9i/win.920/a95496/ch1.htm#1079911) I found Oracle's documentation that explains this, but it didn't worked for me.
    Oracle Services is installed in both machines.
    The Oracle MTS Recovery Service is running.
    The COM+ component is registered.
    When I use the same component with SQL Server 2005 beta 2 it works fine. What else do I need to do?
    Thanks in advance.
    Caio Pereira

    Hi.
    I have the same problem, one which works and another which don't (almost though).
    I got most of it to work by taking the mtsservices registry entry from the server that works and put it on to the other after i have made the service in Oracle management console for mts.
    Now i can search, delete, change but not make a new entry into the database.
    And thats where i'm stuck now.
    Hope it helps a bit..
    Michael
    Greenland

  • Difference between oracle client and oracle server?

    Hi,
    could any one please tell me the difference between these things?
    1.)oracle client and oracle server
    2.) installtion of oracle client and oracle server
    Thanks in advance.

    Take a look at the general client - server computing model, described e.g. in this wiki.
    edit:
    corrected bad link
    Message was edited by:
    orafad

  • Difference between oracle and BEA JDBC Drivers

    One of our application plan to move from BEA JDBC drives to Oracle drivers.
    We use Weblogic 9.2 as application server and Oracle 10g as the database.
    Questions
    =======
    1. What is the basic difference between these drivers and how do we decide which one to use.
    2. What can be the impact of moving to Oracle drives from BEA on the overall application...?
    3. Other than change in the jdbc.datasource.url = jdbc:oracle:thin:@, do we need to take anything else into consideration.
    Pls. let me know in case any further details are required.
    Thanks in advance.

    "1. What is the basic difference between these drivers and how do we decide which one to use."
    They are totally different products made independently by different companies.
    "2. What can be the impact of moving to Oracle drives from BEA on the overall application...?"
    As long as your application uses standard JDBC APIs, the impacts will be minimized, and
    unpredictable, some running faster, some slower... Any bug list for one driver will be
    different than for the other. If you use any driver-specific extension APIs, they won't
    be in the other driver.
    "3. Other than change in the jdbc.datasource.url = jdbc:oracle:thin:@, do we need to take anything else into consideration."
    Also changing the diver/datasource class name, and reviewing any arguments/driver properties.
    Property names and functions are usually driver-specific.
    Joe

  • Anyone successfully using WL 6.0 and oracle.jdbc.xa.client.OracleXADataSource?

    My final goal is to have two xa pools pointing to different db's and
    have them in the same user transaction and do a 2 phase commit. I
    can't get past connecting to a single xa datasource. I have "Grant
    Select on DBA_PENDING_TRANSACTIONS to public".
    My config.xml snippet:
    <JDBCConnectionPool
    Name="ModelXaPool"
    Targets="WebApp"
    URL="jdbc:oracle:thin:@SERVER1:1521:DB"
    DriverName="oracle.jdbc.xa.client.OracleXADataSource"
    InitialCapacity="2"
    MaxCapacity="10"
    CapacityIncrement="2"
    Properties="user=uid;password=pw"
    RefreshMinutes="10"
    />
    <JDBCTxDataSource
    EnableTwoPhaseCommit="true"
    JNDIName="ModelManagerTxDataSource"
    Name="ModelManagerTxDataSource"
    PoolName="ModelManagerXaPool"
    Targets="WebWORKS"
    />
    My code snippet:
    UserTransaction tx = msgCtx.getUserTransaction();
    tx.begin();
    java.sql.Connection conn =
    (DataSource)ctx.lookup("ModelManagerTxDataSource")).getConnection();
    Statement stmt = conn.createStatement();
    The connection seems to be gotten just fine. On the createStatement,
    I get the following exception.
    java.sql.SQLException: Internal error: Cannot obtain XAConnection
    Creation of XAConnection for pool ModelXaPool failed after
    waitSecs:298
    at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:772)
    at weblogic.jdbc.jta.Connection.getXAConn(Connection.java:130)
    at weblogic.jdbc.jta.Connection.createStatement(Connection.java:201)
    at weblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionImpl.java:71)
    at weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.java:42)
    Any suggestions/advice?
    Thanks,
    Dale

    Hi Dale,
    What version of Oracle are you using at least 8.1.7 is need to be able to
    use Oracle thin driver/XA. Also the JDBCConnectionPool and TxDataSource tags
    dont seem to match here. Both need to be targeted on to the same server. And
    the name of the pool in TxDataSource need to match the pool you have on the
    server.
    To setup oracle for XA you need to make sure this script is run on the
    server, initjvm.sql (It should be in your oracle installation rdbms scripts)
    and then grant select permission on dba_pending_transactions.
    Are you able to setup a connection pool with a non-XA driver?
    sree
    "Dale Bronk" <[email protected]> wrote in message
    news:[email protected]...
    My final goal is to have two xa pools pointing to different db's and
    have them in the same user transaction and do a 2 phase commit. I
    can't get past connecting to a single xa datasource. I have "Grant
    Select on DBA_PENDING_TRANSACTIONS to public".
    My config.xml snippet:
    <JDBCConnectionPool
    Name="ModelXaPool"
    Targets="WebApp"
    URL="jdbc:oracle:thin:@SERVER1:1521:DB"
    DriverName="oracle.jdbc.xa.client.OracleXADataSource"
    InitialCapacity="2"
    MaxCapacity="10"
    CapacityIncrement="2"
    Properties="user=uid;password=pw"
    RefreshMinutes="10"
    />
    <JDBCTxDataSource
    EnableTwoPhaseCommit="true"
    JNDIName="ModelManagerTxDataSource"
    Name="ModelManagerTxDataSource"
    PoolName="ModelManagerXaPool"
    Targets="WebWORKS"
    />
    My code snippet:
    UserTransaction tx = msgCtx.getUserTransaction();
    tx.begin();
    java.sql.Connection conn =
    (DataSource)ctx.lookup("ModelManagerTxDataSource")).getConnection();
    Statement stmt = conn.createStatement();
    The connection seems to be gotten just fine. On the createStatement,
    I get the following exception.
    java.sql.SQLException: Internal error: Cannot obtain XAConnection
    Creation of XAConnection for pool ModelXaPool failed after
    waitSecs:298
    atweblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:772)
    at weblogic.jdbc.jta.Connection.getXAConn(Connection.java:130)
    at weblogic.jdbc.jta.Connection.createStatement(Connection.java:201)
    atweblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionImpl.jav
    a:71)
    atweblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.java:42)
    >
    Any suggestions/advice?
    Thanks,
    Dale

  • JDBC Thin Client and Oracle Long Datatype

    I am using Wepshere 4.0.2 , JDBC 2.0 (thin driver) and oracle 9i.
    I have a procedure which takes Oracle Long Datatype as its parameter.
    I use following code to execute procedure.
    String dataforsql="AAA000000003 123123 07/01/200301/01/2003";
    byte[] bytes = dataforsql.getBytes();
    InputStream is = new ByteArrayInputStream(bytes);
    cstmt=conn.prepareCall("call nscw.CPPF_SAVEPDCRAWTABLE2(?,?,?)");
    cstmt.setAsciiStream (1, is,bytes.length);
    The above code works perfectly for data upto 4000 bytes. Once the data crosses the 4000 mark.
    i get a procedure error
    ORA-01460: unimplemented or unreasonable conversion requested

    cstmt.setAsciiStream (1, is,bytes.length);Oracle's support for CLOB (and BLOB) columns using set{Ascii,Binary}Stream() generally s*cks. You'll have to read Oracle's own JDBC manual (you can read it online at http://technet.oracle.com) for whatever sequence they recommend.
    E.g. for insertion and updation of CLOBS, you're supposed to use an oracle-specific function (EMPTY_CLOB()) as the value in the INSERT/UPDATE statement, and then do a SELECT, getClob(), and use Clob APIs to update the actual column value. At least officially. Or you have to use some Oracle-specific APIs in oracle.sql.Connection and oracle.sql.CLOB.

  • Oracle JDBC Drivers

    We are extracting blobs from an 8.05 database. The following statement works only with an older driver for a version I'm not sure whar it is(size is 1419KB, date is 11/3/00 at 9:25AM).
    Nothing special in the sql just extracting the column.
    pBlob = (oracle.sql.BLOB)rset.getObject(1);
    This works fine with the above mentioned driver. All other drivers I have tested 8.15 for 8i, 8.05, 7.34, 8.04, etc. all give the network datatype unsupported error at this statement. I tried the various examples but they were for the oci8 drivers and did not work with thin.
    We use the thin(type 4) driver.
    Do the new drivers not support the BLOB type for thin?
    Does anyone know which driver version and database that the one I described is from?
    Thanks.

    user452131,
    Yes, there are differences between the Oracle 8i JDBC drivers and the Oracle 9i JDBC drivers.
    If you haven't already done so, I suggest perusing the following Web page:
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html
    Good Luck,
    Avi.

  • Oracle JDBC Drivers with Tomcat

    I try to connect to Oracle DB with the JDBC Drivers throught Tomcat JNDI access.
    I've tried with the oracle.jdbc.driver.OracleDriver and I have an UnsupportedOperationException when calling the getConnection() method on ma dataSource ref.
    So I've tried with the oracle.jdbc.pool.OracleConnectionPoolDataSource and I have an java.sql.SQLException:
    Cannot create JDBC driver of class
    'oracle.jdbc.pool.OracleConnectionPoolDataSource' for connect URL
    'jdbc:oracle:thin:@(description=(address=(host=meditws322)(protocol=tcp)(port=1521)
    )(connect_data=(sid=HABILLE)))'
    Please help I'm about to break down

    Thanks for your reply. I use Oracle JDBC driver. The XSQLConfig.xml was changed to have the following setting:
    <connection-manager>
    <factory>oracle.xml.xsql.XSQLOracleDatasourceConnectionManager</factory>
    </connection-manager>
    I'm using Tomcat 4.1.x and Apache Commons DBCP Datasources with org.apache.commons.dbcp.BasicDataSourceFactory. The configuration file does set driverClassName to oracle.jdbc.driver.OracleDriver. All other queries embedded in .xsql files work great, I only have issues with queries containing CURSOR() statements. If I switch back to built-in database connectivity, by changing XSQLConfig.xml and connection parameters in .xsql files everything is working again. When I attempt to use DataSources, I get things like this "oracle.jdbc.driver.OracleResultSetImpl@15780d9" instead of nested XML. The non-nested portion of XML looks fine also, so it is retrieving the data from the database properly. Please let me know if I can provide any additional information that could help in resolving this. Thanks in advance!
    -M-

  • OAS and using JDBC-drivers from EJB

    Hi.
    I have a problem with accessing the database from EJB-components
    deployed to OAS 4.0.8. The database is 8.1.5-version. I'm trying
    to use a connection exactly like it is documented in OAS-EJB-
    documents, the connection string looks like this:
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:jts8:@ora8i");
    And this is the error that above sentence it generates:
    "Sub Protocol must be specified in connection URL".
    The DAD(ora8i) is created in OAS.
    Now, I don't even know if this uses JDBC/OCI or thin since the
    documented connection-string doesn't contain that information. I
    quess it must use OCI-drivers, at least I should use them and
    they should be installed with OAS.
    So:
    * I should use only jts-enabled JDBC-drivers when developing EJB-
    components, is this right?
    * How can I connect to the database (from OAS 4.0.8 to Oracle
    8i), the string please?
    Thanks,
    [email protected]
    null

    Hi Suresh,
    There is lot of Documentation available on this, check these links
    http://help.sap.com/saphelp_nwce10/helpdata/en/45/07d2eeea3e0485e10000000a155369/frameset.htm
    http://help.sap.com/saphelp_nwce10/helpdata/en/45/08546ff5200486e10000000a155369/frameset.htm
    Venkat.

Maybe you are looking for