Connection reset using JDBC Oracle thin Driver (towards 10g DB)
Hi we have a home-grown application and a Oracle 10g (10.2.0.1) database.
We created a scheduled servlet that gets a JDBC connection from a persistent connected cache (an OracleDataSource object registered using OracleConnectionCacheManager). The servlet runs every 15 minutes and runs the query "SELECT SYSTIME FROM DUAL" on 10g Database as XYZ user. The datapool was created yday on web-app and all queries ran successfully for about 5 hours after which it reported a connection reset error.
I can then conclude that we cannot keep the server session alive for the JDBC client by running frequent SQL queries.
We didnt get any messages on the DB server side that indicate the release of the session
Ultimately, we are struggling with reset connections from our applications that are
using the JDBC thin oracle driver; after a couple of hours of idle
connections, we receive the below error from the JDBC driver:
Jul 5, 2007 10:59:53 AM oracle.jdbc.driver.DatabaseError throwSqlException
WARNING: DatabaseError.throwSqlException(e): Unable to find ORA number from
exception Jul 5, 2007 10:59:53 AM oracle.jdbc.driver.DatabaseError
findMessage
WARNING: DatabaseError.findMessage(errNum, obj): returned Io exception:
Connection reset Jul 5, 2007 10:59:53 AM
oracle.jdbc.driver.PhysicalConnection getWarnings
INFO: PhysicalConnection.getWarnings()
Any suggestions please ?
Vk
The code itself is fine; the problem is with one of:
1) the connection URL
2) intermediate networking
3) the database itself
1) your connection URL is "jdbc:oracle:thin:@127.0.0.1:1521:orcl"
- is Oracle really running on the default port, 1521
- is the installation SID really "orcl"
2) lots of possibilities, but only a couple are likely
- is TCP/IP configured and running on your host
- is there a persoanl firewall rpduct running? perhaps it's blocking the connection
3) Is Oracle running?
Is the listener running?
Similar Messages
-
ATG CIM: Not able to connect to database jdbc:oracle:thin
Hi All,
I am trying to setup a ATG environment on windows boxes. Below is the setup:
VM1) DC - Windows Domain Controller (Windows Server 2008)
VM2) javadb - Oracle 11g (Windows Server 2008)
VM3) javaweb - ATG 10.0.3 / WebLogic wlserver_10.3/ TomCat 7 (Windows Server 2008)
Installation / Setup Progress
* Oracle 11g installation successful. Sample DB successfully created.
* WebLogic installation successful. Base_Domain successfully created.
* Able to create successful connection to Oracle (javadb vm) from TomCat (javaweb vm) and query data
Error: When configuring CIM I keep on getting >> "Not able to connect to database jdbc:oracle:thin:@javadb:1521:SampleDB @ scott"+_
Corrective action already taken:
1) Disabled firewall on all boxes
2) Added path of JDBC driver (ojdbc6.jar) in Environment Variables
3) Tested Oracle 11g (javadb vm) connectivity both from Eclipse and Tomcat. Which is successful
4) Cleared all files under C:\ATG\ATG10.0.3\CIM\data to reset CIM
Please refer CIM details below:
===========================================
CIM DISPLAY START
===========================================
-------ENTER CONNECTION DETAILS-----------------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Production Core
Select Database Type
*[1] Oracle Thin
[2] MS SQL
[3] iNet MS SQL
[4] DB2
[5] My SQL
Select one > 1
Enter User Name [[system]] > scott
Enter Password [[**********]] > **********
Re-enter Password > **********
Enter Host Name [[javadb]] > javadb
Enter Port Number [[1521]] > 1521
Enter Database Name [[sampledb]] > SampleDB
Enter Database URL [[jdbc:oracle:thin:@javadb:1521:SampleDB]]
>
Enter Driver Path [[C:/Oracle/Middleware/wlserver_10.3/server/lib/ojdbc6.jar]]
Enter JNDI Name [[ATGProductionDS]] >
-------CONFIGURE DATASOURCE PRODUCTION CORE-----------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
[C] Connection Details - Done
*[T] Test Connection
[S] Create Schema
Import Initial Data
[D] Drop Schema
[O] Configure Another Datasource
> T
-------TEST DATASOURCE CONNECTION---------------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Production Core
>> Not able to connect to database jdbc:oracle:thin:@javadb:1521:SampleDB @ scott
===========================================
CIM DISPLAY END
===========================================
===========================================
CIM LOG START
===========================================
**** Warning Mon Jul 23 22:46:25 IST 2012 1343063785645 atg.cim.worker.status.StatusUpdateValidator Status id nonswitchingCore-DatasourceConnectionTemplateStep is unknown.
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator Not able to connect to database jdbc:oracle:thin:@javadb:1521:SampleDB : -1 java.lang.ArrayIndexOutOfBoundsException: -1
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.T4CTTIoauthenticate.setSessionFields(T4CTTIoauthenticate.java:948)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.T4CTTIoauthenticate.<init>(T4CTTIoauthenticate.java:225)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:358)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:538)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at java.sql.DriverManager.getConnection(DriverManager.java:582)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at java.sql.DriverManager.getConnection(DriverManager.java:185)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.BasicDataSource.getDriverManagerConnection(BasicDataSource.java:526)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.BasicDataSource.getDriverManagerConnection(BasicDataSource.java:588)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.BasicDataSource.getConnection(BasicDataSource.java:475)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.FakeXADataSource.getXAConnection(FakeXADataSource.java:671)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.MonitoredDataSource.createResource(MonitoredDataSource.java:837)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.resourcepool.ResourcePool.populateSlot(ResourcePool.java:2064)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.resourcepool.ResourcePool.checkOut(ResourcePool.java:1332)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.MonitoredDataSource.co(MonitoredDataSource.java:1792)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.MonitoredDataSource.getConnection(MonitoredDataSource.java:1070)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.worker.databaseconfig.TestJdbcConnectionValidator.performTestConnection(TestJdbcConnectionValidator.java:319)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.worker.databaseconfig.TestJdbcConnectionValidator.validate(TestJdbcConnectionValidator.java:266)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.executeValidations(StepExecutor.java:280)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.ui.text.TextDisplay.processStep(TextDisplay.java:338)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.ui.UIDispatchImpl.processStep(UIDispatchImpl.java:89)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processStep(StepExecutor.java:201)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processCurrentStep(StepExecutor.java:80)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.runner.Runner.run(Runner.java:152)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.types.LaunchTemplate.execute(LaunchTemplate.java:69)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.execute(CommandExecutor.java:128)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.executeCommands(CommandExecutor.java:156)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processStep(StepExecutor.java:129)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processCurrentStep(StepExecutor.java:80)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.runner.Runner.run(Runner.java:152)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.types.LaunchTemplate.execute(LaunchTemplate.java:69)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.execute(CommandExecutor.java:128)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.executeCommands(CommandExecutor.java:156)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processStep(StepExecutor.java:129)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processCurrentStep(StepExecutor.java:80)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.runner.Runner.run(Runner.java:152)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.types.LaunchTemplate.execute(LaunchTemplate.java:69)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.execute(CommandExecutor.java:128)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.executeCommands(CommandExecutor.java:156)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processStep(StepExecutor.java:129)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processCurrentStep(StepExecutor.java:80)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.runner.Runner.run(Runner.java:152)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.types.LaunchWizard.execute(LaunchWizard.java:73)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.execute(CommandExecutor.java:128)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.executeCommands(CommandExecutor.java:156)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processStep(StepExecutor.java:216)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processCurrentStep(StepExecutor.java:80)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.runner.Runner.run(Runner.java:152)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.flow.CimFlow.startupFlow(CimFlow.java:69)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.flow.CimFlowCreator.startDefaultCimFlow(CimFlowCreator.java:78)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.Launcher.startCimFlow(Launcher.java:168)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.Launcher.main(Launcher.java:68)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792218 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator Error initializing connection from parameters. Test for jdbc connection failed
===========================================
CIM LOG END
===========================================
Any suggestion how to resolve this issue. Thanks in advance.
cheers,
Sandeep
Edited by: 948180 on Jul 23, 2012 11:29 PMHi,
Earlier my ojdbc6.jar path was not at the beginning of ClassPath. I have made necessary changes. Please refer below:
Environment Variables Settings on machine where CIM resides:
PATH = C:\Oracle\Middleware\wlserver_10.3\server\lib\ojdbc6.jar+;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Java\jre7\bin;C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin;C:\Program Files\cvsnt;C:\Program Files\Java\jdk1.7.0\bin;C:\Program Files\Sun\JavaDB\bin;C:\Program Files\Sun\JavaDB\lib;;C:\ATG\ATG10.0.3\MySQL\win32\bin;C:\ATG\ATG10.0.3\home\bin\;C:\Oracle\Middleware\wlserver_10.3\server\lib\;
Note: I have verified by ojdbc6.jar path.
Below are the precise steps I executed after updating my environment variables and restarting CMD.
===========================================
CIM DISPLAY START
===========================================
C:\ATG\ATG10.0.3\home\bin>cim.bat
Nucleus running
_ | () |
__ _ | |_ __ _ ----
/ _` | | __| / _` |
| (_| | | |_ | (_| |
\__,_| \__| \__, |
|___/
Configuration Installation Manager
=======CIM MAIN MENU============================================================
enter [h]elp, [q]uit to exit
Choose the task you want to perform:
*[1] Database Configuration
[2] Server Instance Configuration
[3] Application Assembly & Deployment
[P] Product Selection - Done (ATG B2C Commerce)
[A] Select Application Server - Done (Weblogic Online)
[C] Custom CIM Plugin Launcher
> 1
-------CALCULATE DATASOURCE DEPENDENCIES----------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Calculating Datasource Dependencies. View log file at C:/ATG/ATG10.0.3/home/
../CIM/log/cim.log
|. . |
|. . |
-------SELECT A DATASOURCE TO CONFIGURE-----------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
*[P] Publishing
[C] Production Core
[D] Done
> c
-------CONFIGURE DATASOURCE PRODUCTION CORE-------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
[C] Connection Details - Done
*[T] Test Connection
[S] Create Schema
Import Initial Data
[D] Drop Schema
[O] Configure Another Datasource
> t
-------TEST DATASOURCE CONNECTION-----------------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Production Core
>> Not able to connect to database jdbc:oracle:thin:@javadb:1521:SampleDB @
scott
*[E] Edit Connection Details
[R] Redo
[D] Done
> e
-------RE-USE VALUES FROM PREVIOUS DATASOURCE-----------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Production Core
Base on previous database details:
[1] system@jdbc:oracle:thin:@javadb:1521:sampledb
[2] scott@jdbc:oracle:thin:@javadb:1521:SampleDB
*[3] None/Use Existing
Select one > 2
-------ENTER CONNECTION DETAILS-------------------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Production Core
Select Database Type
*[1] Oracle Thin
[2] MS SQL
[3] iNet MS SQL
[4] DB2
[5] My SQL
Select one > 1
Enter User Name [[scott]] > scott
Enter Password [[**********]] > **********
Re-enter Password > **********
Enter Host Name [[javadb]] > javadb
Enter Port Number [[1521]] > 1521
Enter Database Name [[SampleDB]] > SampleDB
Enter Database URL [[jdbc:oracle:thin:@javadb:1521:SampleDB]]
> jdbc:oracle:thin:@javadb:1521:SampleDB
Enter Driver Path [[C:/Oracle/Middleware/wlserver_10.3/server/lib/ojdbc6.jar]
] > C:\Oracle\Middleware\wlserver_10.3\server\lib\ojdbc6.jar
Enter JNDI Name [[ATGProductionDS]] > ATGProductionDS
-------CONFIGURE DATASOURCE PRODUCTION CORE-------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
[C] Connection Details - Done
*[T] Test Connection
[S] Create Schema
[I] Import Initial Data
[D] Drop Schema
[O] Configure Another Datasource
> T
-------TEST DATASOURCE CONNECTION-----------------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Production Core
>> Not able to connect to database jdbc:oracle:thin:@javadb:1521:SampleDB @
scott
*[E] Edit Connection Details
[R] Redo
[D] Done
>
===========================================
CIM DISPLAY END
===========================================
Don't understand what could possibly be going wrong.
Cheers,
Sandeep
Edited by: 948180 on Jul 24, 2012 12:23 AM -
CallableStatement does not run PL/SQL with jdbc:oracle:thin driver
I have a very simple PL/SQL function:
FUNCTION CalculateDistance
(x1 IN NUMBER, y1 IN NUMBER, x2 IN NUMBER, y2 IN NUMBER)
RETURN NUMBER
AS
distance NUMBER;
BEGIN
distance := SQRT(POWER(x1-x2,2) + POWER(y1-y2,2));
return distance;
END;
I call it with:
CallableStatement cs = null;
try {
biomassStatement = con.prepareCall("{ call MYPACKAGE.CalculateDistance(?, ?, ?, ?, ?)}");
cs.setDouble("X1", -367546.78402892);
cs.setDouble("Y1", 150712.8161204);
cs.setDouble("X2", -2155095.49289);
cs.setDouble("Y2", 774013.149084);
cs.registerOutParameter("v_Return", OracleTypes.NUMBER);
cs.execute();
The only answer I get is:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'CALCULATEDISTANCE'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
I tried it with different Data sources (common, pool, XA) and nothing works...
Tried using ojdbc14_g.jar to see if could get more information with no help...
HELP!!!Hi,
You are calling a FUNCTION, i.e you have one return value (And four arguments)
So according to javadocs
http://download.oracle.com/javase/6/docs/api/java/sql/CallableStatement.html
Your synbtax should be like:
{?= call <procedure-name>[(<arg1>,<arg2>, ...)]}Rigtht now, your call seems to be for a procedure having five arguments.
Regards
Peter -
Web Logic 6.1 JDBC Pooling with the Oracle Thin Driver
Hi,
We're slowly getting through a WebLogic 4.5.1 to 6.1 conversion for a small application
at my company. Initially, we had trouble getting the Oracle thin driver working.
We've finally cracked this nut. Now we're trying to get pooling working, and
cannot find an example of doing this with the Oracle thin driver.
Would anyone be able to provide:
1. the portion of the config.xml that pertains to building a connection pool using
the Oracle thin driver
2. the two lines of code for loading the driver and getting a connection from
this pool
i.e.
Driver d = (Driver)Class.forName("weblogic.jdbc.pool.Driver").newInstance();
Connection c = d.connect("jdbc:weblogic:pool:myPool", null);
Thanks very much!
Jeff Ryan
The Hartford"Jeff Ryan" <[email protected]> wrote:
>
1. the portion of the config.xml that pertains to building a connection
pool using
the Oracle thin driver
You don't usually edit the config.xml unless it is absolutely necessar. Instead,
you can config the pool in the GUI admin console, quite easily. After you successfully
configed the pool in the console, it is written into the config.xml file for you.
Only thing special when config the pool is the name of the driver and the url.
url: jdbc:oracle:thin@dbhost:dbport:dbinstance
driver: oracle.jdbc.driver.OracleDriver
If you prefer, you can also config the pool from the command line. It is detailed
in the "Weblogic Server Command-line Interface Reference".
2. the two lines of code for loading the driver and getting a connection
from
this pool
i.e.
Driver d = (Driver)Class.forName("weblogic.jdbc.pool.Driver").newInstance();
Connection c = d.connect("jdbc:weblogic:pool:myPool", null);
Again, you don't use the connection directly. Instead, you use "Data Source".
Data source in weblogic is just a connection object factory associated with a
JNDI name. You can therefore lookup the data source with the JNDI name and from
the data source object, you get the connectin object. No need to explicitly load
the driver class.
There are plenty of example codes available in the weblogic examples installed
with 6.1, that uses the data source.
Charles -
Hi, We are using Weblogic 6.1. We are currently using JDBC Oracle Thin Driver (ClassName
: oracle.jdbc.driver.OracleDriver) that is built into Weblogic 6.1 (weblogic.jar).
Our database is Oracle 8.1.7.4. We want to upgrade to Oracle 9i (Oracle version
9.2.0.4). I would like to know the compatibility of this built-in Driver for Weblogic
6.1 with Oracle 9i (9.2.0.4) and can I continue to use the same JDBC driver. Also
we have plans to upgrade our Weblogics to 8.1 version. Can we continue to use
the same Oracle Thin driver that comes as part of WLS 8.1, for Oracle 9.2.0.4.
I need this reply ASAP. I appreciate any help in this regard.
Thanks, Venkatesan.Thank you very much for your reply.
Joe Weinstein <[email protected]> wrote:
Hi. The driver we shipped will still work with the later DBMS, but there
have been many improvements and fixes to Oracle's dirver since then,
so I highly recommend that you download Oracle's latest appropriate
thin driver, and make sure it gets into the -classpath argument that
the weblogic startup script creates for the server.
Every release of weblogic will tend to include the latest oracle
thin driver available at the time, so the 8.1 will contain a newer one
than
the 6.1.
Joe
Venkatesan wrote:
Hi, We are using Weblogic 6.1. We are currently using JDBC Oracle ThinDriver (ClassName
: oracle.jdbc.driver.OracleDriver) that is built into Weblogic 6.1(weblogic.jar).
Our database is Oracle 8.1.7.4. We want to upgrade to Oracle 9i (Oracleversion
9.2.0.4). I would like to know the compatibility of this built-in Driverfor Weblogic
6.1 with Oracle 9i (9.2.0.4) and can I continue to use the same JDBCdriver. Also
we have plans to upgrade our Weblogics to 8.1 version. Can we continueto use
the same Oracle Thin driver that comes as part of WLS 8.1, for Oracle9.2.0.4.
I need this reply ASAP. I appreciate any help in this regard.
Thanks, Venkatesan. -
Jdbc connection using oracle thin driver( using jdk1.4 and oracle8 )
hello ..
while i was tring to connection using oracle thin driver and jdk1.4 am getting the below error message. i have set the class path for the driver also. am using oracle8 personal edition and jdk1.4.
[java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:468)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at Connexa.main(Connexa.java:18)[/b]
Press any key to continue...
my program is....
import java.sql.*;
import java.io.*;
import java.util.*;
import oracle.jdbc.driver.*;
// needed for new BFILE class
import oracle.sql.*;
public class Connexa {
public static void main (String args []) throws Exception {
Statement stmt=null;
try{
// Load the Oracle JDBC driver
//DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Class.forName("oracle.jdbc.driver.OracleDriver");
// Connect to the database
// You can put a database name after the @ sign in the connection URL.
Connection conn =
DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:orcl","scott","tiger");
//Connection conn =
// DriverManager.getConnection ("jdbc:odbc:datasource", "system", "manager");
stmt = conn.createStatement ();
catch (SQLException e)
e.printStackTrace();The code itself is fine; the problem is with one of:
1) the connection URL
2) intermediate networking
3) the database itself
1) your connection URL is "jdbc:oracle:thin:@127.0.0.1:1521:orcl"
- is Oracle really running on the default port, 1521
- is the installation SID really "orcl"
2) lots of possibilities, but only a couple are likely
- is TCP/IP configured and running on your host
- is there a persoanl firewall rpduct running? perhaps it's blocking the connection
3) Is Oracle running?
Is the listener running? -
How to use oracle thin driver?...pls help
Hello. I am trying to insert a word file into my Oracle 9i database using JSP. I have tomcat running as my standalone server. So far, i have been using the sun.jdbc.odbc driver to implement all my DB accesses. Recently however, i found out that in order to use Oracle specific objects such as BLOBS or BFILES, i have to use the oracle thin driver or OCI driver.
So far, i have downloaded the thin driver and put it into the tomcat shared/common folder and also put the .jar file into my classpath. Now, i am having trouble as to how to call the oracle thin driver inside my JSP code.
My previous code read as:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:Andy","user","pass");
How do i switch over to the oracle thin driver in JSP? Any help would be much appreciated. Thank you
AndrewClass.forName ("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@hostname:port:SSID", "user", "password"); -
How to use oracle thin driver with jsp?...pls help
Hello. I am trying to insert a word file into my Oracle 9i database using JSP. I have tomcat running as my standalone server. So far, i have been using the sun.jdbc.odbc driver to implement all my DB accesses. Recently however, i found out that in order to use Oracle specific objects such as BLOBS or BFILES, i have to use the oracle thin driver or OCI driver.
So far, i have downloaded the thin driver and put it into the tomcat shared/common folder and also put the .jar file into my classpath. Now, i am having trouble as to how to call the oracle thin driver inside my JSP code.
My previous code read as:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:Andy","user","pass");
How do i switch over to the oracle thin driver in JSP? Any help would be much appreciated. Thank you
Andrewmy code is:
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection(sConnStr, sUser, sPassword);
notice the driver --"oracle.jdbc.driver.OracleDriver"!
and copy the class12.zip to lib path
if still not work
change the class12.zip to class12.jar
good luck -
Using Oracle thin driver with Weblogic 6.1
hi all,
i am trying to create a ConnectionPool using WLS6.1 and Oracle 8.0.5.
Since i cannot use the weblogic driver (due to the old version of oracle that
i have)
i am trying to use instead the oracle thin driver.
i configured my pool as follows:
URL jdbc:oracle:[email protected]:1521:ORC1
Driver oracle.jdbc.Driver.OracleDriver
Propeties user=SCOTT
when i try to assing the created pool to a server (using the 'Target' link),
i always got this exception
weblogic.management.DeploymentException: Error creating connection pool - with
n
ested exception:
[weblogic.common.ResourceException: Cannot load driver class: oracle.jdbc.Driver
.OracleDriver]
at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:110)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:329)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:144)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:608)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:592)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:352)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBean
s(ConfigurationMBeanImpl.java:484)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:354)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:449)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:190)
at $Proxy7.addDeployment(Unknown Source)
at weblogic.management.internal.DynamicMBeanImpl.updateDeployments(Dynam
icMBeanImpl.java:1448)
at weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBe
anImpl.java:858)
at weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBe
anImpl.java:810)
at weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(Conf
igurationMBeanImpl.java:288)
at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.j
ava:1356)
at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.j
ava:1331)
at weblogic.management.internal.MBeanProxy.setAttribute(MBeanProxy.java:
303)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
at $Proxy75.setTargets(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.console.info.FilteredMBeanAttribute.doSet(Filtere
dMBeanAttribute.java:89)
at weblogic.management.console.actions.mbean.DoEditMBeanAction.perform(D
oEditMBeanAction.java:116)
at weblogic.management.console.actions.internal.ActionServlet.doAction(A
ctionServlet.java:167)
at weblogic.management.console.actions.internal.ActionServlet.doPost(Act
ionServlet.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2456)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2039)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
--------------- nested within: ------------------
weblogic.management.DistributedOperationUpdateException: Error creating connecti
on pool - with nested exception:
[weblogic.management.DeploymentException: Error creating connection pool - with
nested exception:
[weblogic.common.ResourceException: Cannot load driver class: oracle.jdbc.Driver
.OracleDriver]]
at weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBean
s(ConfigurationMBeanImpl.java:494)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:354)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:44>
However, i set the CLASSPATH & PATH of my startWebLogic.cmd as follows:
set PATH=c:\orant\bin;d:\bea\wlserver6.1\bin\oci817_8;.\bin;%PATH%
set CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;.\samples\eval\cloudscape\lib\cloudscape.jar;.\config\examples\serverclasses;c:\orant\jdbc\lib\classes111.zip
AND, i have written a small program that uses JDBC (without weblogic) to query
a table
on the Oracle (using the pool's URL in the properties for getting the Connection
conn = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:ORC1", "scott",
"tiger");
and that program works fine.
Can anyone tell me what is wrong?? it seems that everything is in order (with
respect to CLASSPATH, PATH etc..)
hope someone can solve my problem
thanx and regards
marcoyour url should be
jdbc:oracle:thin:@127.0.0.1:1521:ORC1
notice the ':' before the '@'.
sree
"Marco" <[email protected]> wrote in message
news:[email protected]...
Hi Sree,
You have to place the classes11.zip file in the beginning of the classpath.i did it. my CLASSPATH is now
CLASSPATH=c:\orant\jdbc\lib\classes111.zip;.;.\lib\weblogic_sp.jar;.\lib\web
logic.jar;.\samples\eval\cloudscape\lib\cloudscape.jar;.\config\examples\ser
verclasses
But now, when i assign the target, the exception is:
--------------- nested within: ------------------
weblogic.management.DistributedOperationUpdateException: Error creating
connecti
on pool - with nested exception:
[weblogic.management.DeploymentException: Error creating connection pool -
with
nested exception:
[weblogic.common.ResourceException: weblogic.common.ResourceException:
Could not create pool connection. The DBMS driver exception was:
java.sql.SQLException: Sub Protocol must be specified in connection URL
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:352)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:102)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
nectionEnvFactory.java:192)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
nectionEnvFactory.java:134)
at
weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
cator.java:698)
at
weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
ava:282)
at
weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
ava:629)
at
weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
at
weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:329)
at
weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:144)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:608)
at
weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
java:592)
at
weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:352)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at
weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBean
s(ConfigurationMBeanImpl.java:484)
at
weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:354)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:449)
at
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:190)
at $Proxy8.addDeployment(Unknown Source)
at weblogic.management.internal.DynamicMB>
what is SubProtocol???
my ConnectionPool is configured as follows:
Name: MyJDBC Connection Pool
URL : jdbc:oracle:[email protected]:1521:ORC1
Driver: oracle.jdbc.driver.OracleDriver
Properties: user=SCOTT
Password : tiger
can u help me???
thanx in advance and regards
marco
>
>
at
weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:110)
at
weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:329)
at
weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:144)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:608)
at
weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
java:592)
at
weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:352)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at
weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBean
s(ConfigurationMBeanImpl.java:484)
at
weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:354)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:449)
at
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:190)
at $Proxy7.addDeployment(Unknown Source)
at
weblogic.management.internal.DynamicMBeanImpl.updateDeployments(Dynam
icMBeanImpl.java:1448)
at
weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBe
anImpl.java:858)
at
weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBe
anImpl.java:810)
at
weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(Conf
igurationMBeanImpl.java:288)
at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.j
ava:1356)
at
com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.j
ava:1331)
at
weblogic.management.internal.MBeanProxy.setAttribute(MBeanProxy.java:
303)
at
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:185)
at $Proxy75.setTargets(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at
weblogic.management.console.info.FilteredMBeanAttribute.doSet(Filtere
dMBeanAttribute.java:89)
at
weblogic.management.console.actions.mbean.DoEditMBeanAction.perform(D
oEditMBeanAction.java:116)
at
weblogic.management.console.actions.internal.ActionServlet.doAction(A
ctionServlet.java:167)
at
weblogic.management.console.actions.internal.ActionServlet.doPost(Act
ionServlet.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:265)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2456)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2039)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
--------------- nested within: ------------------
weblogic.management.DistributedOperationUpdateException: Error creating
connecti
on pool - with nested exception:
[weblogic.management.DeploymentException: Error creating connection pool
with
nested exception:
[weblogic.common.ResourceException: Cannot load driver class:
oracle.jdbc.Driver
OracleDriver]]
at
weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBean
s(ConfigurationMBeanImpl.java:494)
at
weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:354)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at
weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:44>
However, i set the CLASSPATH & PATH of my startWebLogic.cmd as follows:
set PATH=c:\orant\bin;d:\bea\wlserver6.1\bin\oci817_8;.\bin;%PATH%
set
CLASSPATH=.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;.\samples\eval\cloudsc
a
pe\lib\cloudscape.jar;.\config\examples\serverclasses;c:\orant\jdbc\lib\clas
ses111.zip
AND, i have written a small program that uses JDBC (without weblogic)
to
query
a table
on the Oracle (using the pool's URL in the properties for getting the
Connection
conn = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:ORC1",
"scott",
"tiger");
and that program works fine.
Can anyone tell me what is wrong?? it seems that everything is in order
(with
respect to CLASSPATH, PATH etc..)
hope someone can solve my problem
thanx and regards
marco -
Problem in getting Time info with webLogic using Oracle Thin Driver
We have a servlet to store/retrieve date/time data from an Oracle 9i db using use the Oracle thin driver. Everyting is ok when run on JSDK2.1 servlet container or Tomcat. But when run under WebLogic 8.1, we have problem with time portion info, it is lost. After debuging, we found under WebLogic, the returned object type is a java.sql.Date which by definition has no time info, while in other servlet containers, it is a java.sql.Timestamp. Storing date/time data in a Date column is ok under WebLogic because we see the time portion data in the db table. We did not set anything about database/jdbc in WebLogic.
It would be greatly appreciated if someone can explain what effect WebLogic has on a servlet that has its own jdbc connection or how WebLogic could change data type from a jdbc sql statement.That's a function of the JDBC driver, not the J2EE app server.
Sounds like maybe you're using the WebLogic 8.1 driver when you deploy with WL instead of the Oracle driver. You certainly can deploy with the Oracle driver. Go into the WL config manager and set it up to use the ojdbc14.jar instead.
% -
Which Oracle Thin Driver Classes are used at runtime ?
Hi,
I am using Weblogic 6.1 sp1 on a WIN 2000 Professional Box and am trying to connect
to a Oracle 8.1.7 Database that is located on a Solaris Box. I am using the Oracle
Thin Driver (classes12.zip) supplied by Oracle.
The relevant portion of config.xml looks like this:
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
InitialCapacity="12" LoginDelaySeconds="1" MaxCapacity="24"
Name="xxxConnectionPool" Password="xxxxxxxx"
Properties="user=user123" Targets="xxxserver" URL="jdbc:oracle:thin:@1.2.3.4:1521:xxxx"/>
The start script for the Server includes a CLASSPATH variable that includes both
weblogic.jar and classes12.zip (in that order)
The Database access code is from a singleton that is deployed with the beans and
looks like :
Context ctx = new InitialContext();
Object o = ctx.lookup("resonateDataSource");
dataSource = (DataSource)o;
Connection con = dataSource.getConnection();
PreparedStatement ps = con.prepareStatement(sqlXXX);
The actual subclasses of DataSource, Connection, PreparedStatement that are called
at runtime are from weblogic jDriver classes like weblogic.jdbc.rmi.SerialPreparedStatement,
weblogic.jdbc.rmi.SerialConnection etc and not from oracle thin driver.
Is this expected ? Why arent the corresponding classes from the Oracle Thin Driver
loaded ?
Thanks,
PraveenPraveen wrote:
Hi,
I am using Weblogic 6.1 sp1 on a WIN 2000 Professional Box and am trying to connect
to a Oracle 8.1.7 Database that is located on a Solaris Box. I am using the Oracle
Thin Driver (classes12.zip) supplied by Oracle.
The relevant portion of config.xml looks like this:
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
InitialCapacity="12" LoginDelaySeconds="1" MaxCapacity="24"
Name="xxxConnectionPool" Password="xxxxxxxx"
Properties="user=user123" Targets="xxxserver" URL="jdbc:oracle:thin:@1.2.3.4:1521:xxxx"/>
The start script for the Server includes a CLASSPATH variable that includes both
weblogic.jar and classes12.zip (in that order)Hi. You should have the oracle zip first. This is because our stuff also contains an oracle zip, but
it's
older than the latest, and you want yours to be used. Whatever is first in the classpath is what will
be used.
The Database access code is from a singleton that is deployed with the beans and
looks like :...
The actual subclasses of DataSource, Connection, PreparedStatement that are called
at runtime are from weblogic jDriver classes like weblogic.jdbc.rmi.SerialPreparedStatement,
weblogic.jdbc.rmi.SerialConnection etc and not from oracle thin driver.
Is this expected ? Why arent the corresponding classes from the Oracle Thin Driver
loaded ?Yes it is expected. The oracle classes are loaded, and used under the covers. All access
to JDBC connections and JDBC objects via our pools and DataSources will be via a
wrapper object of ours. This is necessary to allow us to retain control over the pool and
User Transactions. Also, because the DataSource is supposed to work whether from
a serverside class or an external client JVM, there will have to be an intermediary JDBC
object that acts as a proxy from the external client to the real thin driver connection
in the server. One can't ship JDBC connections across the wire as-is.
Thanks,
Praveen -
Using Oracle Thin Driver w/WL 6.0
I'm trying to create a JDBC Connection Pool in the WL 6.0 Console that uses
the Oracle
Thin Driver. The name is 'oraclePool'. I have the following properties
defined for the
Connection Pool.
URL = 'jdbc:oracle:thin@localhost:7001:myserver'. I imagine this is wrong
but don't know which section.
Driver Class Name = 'oracle.jdbc.driver.OracleDriver'
Properties =
user=tiger
password=scott
dll=ocijdbc8
server=oracle
protocol=thin
When I start the default weblogic server under mydomain connected to
localhost:7001, I receive the
following error message:
<Oct 22, 2001 9:52:55 PM EDT> <Error> <JDBC Connection Pool> <Cannot startup
connection pool "oraclePool" weblogi
n.ResourceException:
Could not create pool connection. The DBMS driver exception was:
java.sql.SQLException: Io exception: SO Exception was generated
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:210)
at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Connection
EnvFactory.java:155)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Connection
EnvFactory.java:114)
at
weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllocator.j
ava:649)
at
weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.java:243
at
weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.java:322
etc. etc.
I want to use this Connection Pool in a Data Source with the folllowing
properties:
Name = MyJDBCOracleData Source
JNDI Name = oracleDataSource
Pool Name = oraclePool.
I'm assuming the 'Pool Name' mentioned above refers to the 'oraclePool'
connection pool. I'm running everything locally on Win 2000. The path to the
classes111.zip (the Oracle Thin Driver Classes) is
in the system classpath and in the setEnv.cmd under Weblogic.
Any help is GREATLY appreciated.Oracle thin driver is classes12.zip and not classes111.zip.
Make sure you are adding while classpath including filename classes12.zip in
classpath.
Mitesh Patel
Bill Blackmon wrote:
I'm trying to create a JDBC Connection Pool in the WL 6.0 Console that uses
the Oracle
Thin Driver. The name is 'oraclePool'. I have the following properties
defined for the
Connection Pool.
URL = 'jdbc:oracle:thin@localhost:7001:myserver'. I imagine this is wrong
but don't know which section.
Driver Class Name = 'oracle.jdbc.driver.OracleDriver'
Properties =
user=tiger
password=scott
dll=ocijdbc8
server=oracle
protocol=thin
When I start the default weblogic server under mydomain connected to
localhost:7001, I receive the
following error message:
<Oct 22, 2001 9:52:55 PM EDT> <Error> <JDBC Connection Pool> <Cannot startup
connection pool "oraclePool" weblogi
n.ResourceException:
Could not create pool connection. The DBMS driver exception was:
java.sql.SQLException: Io exception: SO Exception was generated
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:210)
at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Connection
EnvFactory.java:155)
at
weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Connection
EnvFactory.java:114)
at
weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllocator.j
ava:649)
at
weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.java:243
at
weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.java:322
etc. etc.
I want to use this Connection Pool in a Data Source with the folllowing
properties:
Name = MyJDBCOracleData Source
JNDI Name = oracleDataSource
Pool Name = oraclePool.
I'm assuming the 'Pool Name' mentioned above refers to the 'oraclePool'
connection pool. I'm running everything locally on Win 2000. The path to the
classes111.zip (the Oracle Thin Driver Classes) is
in the system classpath and in the setEnv.cmd under Weblogic.
Any help is GREATLY appreciated. -
JDBC logging disabled with Oracle thin driver
Hi,
I am trying to turn on JDBC logging through the weblogic console application (WL
6.1 with CMP). In the jdbc log file I do not see the SQL statments.
It looks like logging is somehow disabled (check one of the logs statements below)
by some means. Any ideas, I am making use of oracle thin driver.
Thanks
Mohit
Following log messages are generated!!!!!!
DriverManager.initialize: jdbc.drivers = null
JDBC DriverManager initialized
registerDriver: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@4301c9]
DriverManager.getDriver("jdbc:oracle:thin:@(description=(address=(host=192.168.161.120)(protocol=tcp)(port=1521))(connect_data=(sid=DOPERS01)))")
trying driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@4301c9]
getDriver returning driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@4301c9]
DRVR OPER Disabled logging
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
registerDriver: driver[className=weblogic.jdbc.jts.Driver,weblogic.jdbc.jts.Driver@13eb9c]
registerDriver: driver[className=weblogic.jdbc.pool.Driver,weblogic.jdbc.pool.Driver@4f83d1]
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 ResultSet.getMetaData
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 ResultSet.getMetaData
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 ResultSet.getMetaData
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 ResultSet.getMetaData
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 ResultSet.getMetaData
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 ResultSet.getMetaData
DRVR DBG1 Statement.setEscapeProcessingMohit,
Remove oracle/jdbc/driver/OracleLog from classes12.zip, and it should
work (it needs to pick up only this class from weblogic.jar).
Paul
Hi,
I am trying to turn on JDBC logging through the weblogic console application (WL
6.1 with CMP). In the jdbc log file I do not see the SQL statments.
It looks like logging is somehow disabled (check one of the logs statements below)
by some means. Any ideas, I am making use of oracle thin driver.
Thanks
Mohit
Following log messages are generated!!!!!!
DriverManager.initialize: jdbc.drivers = null
JDBC DriverManager initialized
registerDriver: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@4301c9]
DriverManager.getDriver("jdbc:oracle:thin:@(description=(address=(host=192.168.161.120)(protocol=tcp)(port=1521))(connect_data=(sid=DOPERS01)))")
trying driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@4301c9]
getDriver returning driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@4301c9]
DRVR OPER Disabled logging
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
registerDriver: driver[className=weblogic.jdbc.jts.Driver,weblogic.jdbc.jts.Driver@13eb9c]
registerDriver: driver[className=weblogic.jdbc.pool.Driver,weblogic.jdbc.pool.Driver@4f83d1]
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 ResultSet.getMetaData
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 ResultSet.getMetaData
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 ResultSet.getMetaData
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 ResultSet.getMetaData
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 ResultSet.getMetaData
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 Statement.setEscapeProcessing
DRVR DBG1 doDefaultTypes
DRVR DBG1 doDefinesFromTypes
DRVR DBG1 ResultSet.getMetaData
DRVR DBG1 Statement.setEscapeProcessing -
ORA01002 with Oracle thin driver - not with JDriver
Hi,
I use weblogic 5.1 SP10. I was using the weblogic JDriver to create a connection
pool for my entity beans with BMP. I switched from the weblogic Jdrivers to using
the Oracle thin driver (classes12.zip) for my connection pool. Now i get a ORA-01002
(fetch out of sequence) for my ORACLE 8.1.6 SELECT FOR UPDATEs. I can solve this
by - explicitly setting autocommit to false for the connection. This is within
in the EJB transaction.
Why I have to do this with the Oracle thin driver and not with the Weblogic JDriver
Any thoughts on this are appreciated !From this I assume that you know what you are doing but I have to ask, are you
using the TxDataSource to obtain the connection in your BMP entity beans? If
so, I would talk to support...
Anand wrote:
Hi Robert,
I am using the TxDataSource in the workout.properties file.
eg:
weblogic.jdbc.TXDataSource.MyDBPool =MyDBPool
The connection pool is defined as below:
weblogic.jdbc.connectionPool.MyDBPool =\
driver=oracle.jdbc.driver.OracleDriver,\
url=jdbc:oracle:thin:@localhost:1521:MyDb,\
loginDelaySecs=1,\
initialCapacity=10,\
maxCapacity=20,\
capacityIncrement=2,\
allowShrinking=true,\
shrinkPeriodMins=15,\
refreshMinutes=10,testTable=dual,\
props=user=admin;password=password
Robert Patrick <[email protected]> wrote:
How are you obtaining the connection from the pool? Make sure you are
using a
TxDataSource...
Anand wrote:
Hi,
I use weblogic 5.1 SP10. I was using the weblogic JDriver to createa connection
pool for my entity beans with BMP. I switched from the weblogic Jdriversto using
the Oracle thin driver (classes12.zip) for my connection pool. Nowi get a ORA-01002
(fetch out of sequence) for my ORACLE 8.1.6 SELECT FOR UPDATEs. I cansolve this
by - explicitly setting autocommit to false for the connection. Thisis within
in the EJB transaction.
Why I have to do this with the Oracle thin driver and not with theWeblogic JDriver
Any thoughts on this are appreciated ! -
How to set SunOne IDE to work with Oracle thin driver
I am new to the SunOne IDE. I am trying to use the JDBC wizard to generate a form to work with an Oracle table. I want to use the ORacle thin driver but I am not sure how I can tell the IDE where its located. Can someone help? Thanks.
In the explorer window select "RUNTIME".(Bottom of window tabbed pane)
Expand "DATABASES"
Expand "DRIVERS"
Scrolldown and you'll see Oracle thin - click on that and set properties.
Then right click "Oracle thin" click "connect using..."
From here/there you should be able to view all tables you have access to view..etc.
Maybe you are looking for
-
I've noticed over the past week that people have been seeing subpar performance with auto-write XMP turned on while running Lightroom. I think this warrants a more detailed response from the team. Most people using auto-write will experience a minor
-
When I try to open either of these 3 apps the system tells me they can't open because they are currently being updated. Software Update shows my system as needing no update. The last update that it shows was for ProApps Codecs v1.0.5. I am running
-
Editable JCombobox - bug in 10.1.3
Hi I have a JComboBox bound to a ADF view object JComboBox cbo = new JComboBox(); cbo.setEditable(true); cbo.setModel((ComboBoxModel)panelBinding.bindUIControl("PortfolioView1", cbo)); When I type in additional data in the combobox (its editable) and
-
Error at the time of Display of Excise Invoice.
Dear All, My Excise Invoice got saved with the correct values and also the correct number got generated.However when I am going to the display of excise invoice and input the excise invoice number,given the excise year as 2008 and given the correct s
-
5.1 DCP from separate files
Hi there, Can you export a 5.1 DCP by using separate source files as input? I.e. a prores video file and then 6 discreet WAV files making up the 5.1? Everything runs in sync. Thanks, mab