Jdbc connection to Oracle not working
I just had an Oracle 9i database source connection on my Web server created.
It is called: Projects
Here is what my login looks like into the Oracle 9i database:
sqlplus jones/mypassword@//abcd123c/xyz
I was able to connect with Cold Fusion MX tag and connect to the database.
Now I tried to connect using JSP and it keeps saying datasource not found:
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc.oracle:projects:@abcd123c:xyz","jones","mypassword");
.......Please advise.
Your database connection string looks wrong.
There are two different drivers provided with Oracle. The "thin" driver and "oci8". You need to specify which one to use.
Try the following connection string:
jdbc:oracle:thin:@[IPADRESS]:[SID], userName, password
String userName = "jones";
String password = "mypassword";
String address = "abcd123c";
String SID = "xyz";
Class.forName("oracle.jdbc.driver.OracleDriver");
String connectionString = "jdbc:oracle:thin:@" + address + ":" + SID;
Connection conn = DriverManager.getConnection(connectionString, userName, password);
Similar Messages
-
WLS 10.0 JDBC connection pool shrink not working
We seem to be having a problem with jdbc connection pools not shrinking. In the connection pool properties in the WLS console we have:
Initial Capacity 4
Maximum Capacity 15
Shrink Frequency 900
However when I look at the underlying xml config file (see below) the last two values above are not present in the config!
Any ideas what is going on here?
thankyou,
Chris
<?xml version='1.0' encoding='UTF-8'?>
<jdbc-data-source xmlns="http://www.bea.com/ns/weblogic/90" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns
:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xsi:schemaLo
cation="http://www.bea.com/ns/weblogic/920 http://www.bea.com/ns/weblogic/920.xsd">
<name>mdmrDataSource</name>
<jdbc-driver-params>
<url>jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = xxxrac01-vip.nzlxxx01.com) (PORT = 1521))
(ADDRESS = (PROTOCOL = TCP) (HOST = xxxrac02-vip.nzlxxx01.com) (PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA =(SERVE
R = DEDICATED) (SERVICE_NAME = xxxrac.nzlami01.com)))</url>
<driver-name>oracle.jdbc.pool.OracleDataSource</driver-name>
<properties>
<property>
<name>user</name>
<value>xxx_comms</value>
</property>
<property>
<name>fastConnectionFailoverEnabled</name>
<value>true</value>
</property>
<property>
<name>implicitCachingEnabled</name>
<value>true</value>
</property>
<property>
<name>connectionCachingEnabled</name>
<value>true</value>
</property>
<property>
<name>ONSConfiguration</name>
<value>nodes=xxxrac1:6251,xxxrac2:6251</value>
</property>
</properties>
<password-encrypted>xxx</password-encrypted>
</jdbc-driver-params>
<jdbc-connection-pool-params>
<initial-capacity>4</initial-capacity>
<test-connections-on-reserve>true</test-connections-on-reserve>
<test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>
</jdbc-connection-pool-params>
<jdbc-data-source-params>
<jndi-name>jdbc/XXXX</jndi-name>
<global-transactions-protocol>None</global-transactions-protocol>
</jdbc-data-source-params>
</jdbc-data-source>You are right that the XML seems to lask those other settings... Did you
sae those settings from the console?
This is what's in one of mine....
<jdbc-connection-pool-params>
<initial-capacity>0</initial-capacity>
<max-capacity>300</max-capacity>
<shrink-frequency-seconds>900</shrink-frequency-seconds> -
NW04s JDBC Connection for MSSQL not working
In portal JDBC settings are:
Connection properties
URL = jdbc:microsoft:sqlserver://192.168.0.101:1433;DatabaseName=Northwind
Driver = com.microsoft.jdbc.sqlserver.SqlServerDriver
User Management
User mapping type = admin,user
I assigned a user to Administrator under User Administration
Visual Administrator settings are:
DriverName = com.microsoft.jdbc.sqlserver.SqlServerDriver
URL = jdbc:microsoft:sqlserver://192.168.0.101:1433;DatabaseName=Northwind
UserName = empty
Password = empty
Result
Connection test fails in portal. The settings appear ok.
The only thing I can think of is that user specified in portal user mapping is not setup properly on SQLServer.
Also:
When I run link:
http://localhost:53000/TestJDBC_Web/TestJDBCPage.jsp
my jdbc service MSSQL_JDBC does not appear. MSSQL_JDBC was cloned from SDK_JDBC and the libray for drivers was added
I am running MSSQL 2000 SP4 but using JDBC drivers for SP3 as I didn't find any for SP4 and assumed they would work for SP4
What am I missing?Raynald,
I think I am having a similar problem.
I also cloned the connection names in Vis. Administrator to the SDK_name.
Indeed it now appears in the test servlet, and I can succesfully execute SQL statements from there.
So the connector seems ok.
But I have still problems with the Connection Test in the Portal.
I am trying to make BI JDBC system to be able to use my database from the Visual Composer.
I am using these properties:
CodeLink = com.sap.portal.systems.bi.SAP_BI_JDBC
ConnectionFactoryClass = SDK_TESTDB
ConnectionUrl = jdbc:jtds:sqlserver://sapserver:1433;databaseName=TestDb
(this url is the same as in Vis. Administrator)
Driver Class Name = net.sourceforge.jtds.jdbc.Driver
Fixed Catalog = empty
Fixed Schema = empty
System Type = SAP_BI_JDBC
User Mapping = admin, user
I am logged in as Administrator, so I added the login credentials at the User Mapping page of the Administrator user.
When I use Connection Test function from the portal I get the following messages:
Retrieval of default alias successful
Connection failed. Make sure user mapping is set correctly and all connection properties are correct.
What can I do to solve this problem? -
PHP- Oracle not working- Call to undefined function OCILogon() ERROR
Hi,
I am trying to just do a test program to test php - oracle connection,
My versions are: php5.2.1-Win32 and Oracle 10g
I have made the following settings:
1.) Uncommented the following lines in php.ini:
extension=php_oci8.dll
extension=php_oracle.dll
2.) Set extension_dir = "C:\php-5.2.1-Win32\ext"
Changed the httpd.conf file as: ADDED
1.)LoadModule php5_module C:/php-5.2.1-Win32/php5apache2.dll
2.)PHPIniDir "C:/Program Files/Apache Group/Apache2/conf-"
3.) LoadFile "C:/php/php5ts.dll"
4.)<IfModule php5_module>
<Location />
AddType text/html .php .phps
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
</Location>
</IfModule>
5.) AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps
But when I am tryin to run the following program:
<?php
echo "<h1>OCI Test</h1>\n";
$conn=OCILogon("system", "sheetal16", "orcl");
$stmt = OCIParse($conn, "SELECT table_name FROM user_tables ORDER BY table_name");
OCIExecute($stmt, OCI_DEFAULT);
while (OCIFetch($stmt)) {
$table_name = OCIResult($stmt, "TABLE_NAME");
echo "$table_name<br />\n";
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
I am getting the following error:
OCI Test
Fatal error: Call to undefined function OCILogon() in C:\Program Files\Apache Group\Apache2\htdocs\test2.php on line 3
Please help me to solve this problem.
Thanks,
SheetalSee Re: PHP- Oracle not working- Call to undefined function OCILogon() ERROR
-
Just upgraded to Lion an am discovering that I cannot send email photos from within iPhoto. Error message says bad Internet connection or server not working, when that's not the case. Never happened in Snow Leopard! Help!!!
what email service - Yahoo mail have been acting up lately
you can try setting Mail as your email client - it resolves this pfoblem for some people
LN -
Wifi connection with 4s not working after installing new software ios6
wifi connection with 4s not working after installing ios 6.
Go to Settings > WiFi > Select your network and hit the right arrow to "Forget Network"
Then go to Settings > General > Reset Network Settings and try connecting again when the phone restarts. -
IPhone 4s bluetooth connects but does not work handsfree
My iPhone 4s bluetooth connects but does not work handsfree. Has worked fine with My iPhone 3s. The Light on my VW turns green indicating a connect, but the phone does not work through the VWs audio.
Fixed by power cycling the iPhone
-
Connection pooling does not work Oracle Objects! Oracle please respond!
The problem is that when we retrieve Oracle Objects using pooled connection (closing logical connection at the end of every call)it takes 6-8 times longer than in case we share the same physical connection for all database calls. Parts of our application which do not utilize Oracle Objects (just old good relational data) works just fine with pooled connections - no performance degradation
This is my reconstruction of f the what is happening behind the seen, so some parts can be not entirely correct.
OracleConnection class caches StructDescriptor objects in descriptorCache hash table. StructDescriptor objects map content of oracle STRUCTs which are retrieved through the connection onto oracle type names. For example if you retrieve an instance of HR.EMPLOYEE_T oracle object from database some metadata will be retrieved and stored as an entry in descriptorCache cache table associated with "HR.EMPLOYEE_T" key to assist CustomDatum interface. It is a time consuming process and caching of this metadata improves it dramatically.
Now when using pooled connection descriptorCache gets cleared when you close your logical connection (java.sql.Connection) so next time you get a connection from your pooled connection it will have to repopulate the cache which as I said is very time consuming. As a result even though we can reuse our physical connection by using pooled connection whole setup does not work - fetching metadata takes a long time and we cant use Oracle objects in EJB environment (or Servlet environment)
Alex Roytman
Peace Technology, Inc.
(301) 206-9696
nullcheck out managed datasources in the manuals
-
Error while creating a JDBC connection to Oracle 11g using WLS 6.1
Hi
I am trying to connect to Oracle 11g database on Weblogic 6.1 server.
First of all i would like to know if this is compatible?
The environement that i have is this
1. JDK 1.3
2. Database 11g is on remote system
3. Oracle client on my local system ( Connecting to the 11g DB through the client works fine)
4. Weblogic server 6.1
5. Currently the application is connected to Oracle 10g DB and working fine(We are attempting to move it to 11g)
Below are the steps that i followed to create the connection:
1. Made an entry for the datasource in config.xml under <WLS_DOMAIN>/config folder as below
<JDBCConnectionPool DriverName="oracle.jdbc.driver.OracleDriver"
MaxCapacity="4" Name="CADConnectionPool"
Properties="user=abc_proxy;password=proxy_abc;dll=ocijdbc8;protocol=thin"
RefreshMinutes="5" ShrinkPeriodMinutes="10" Targets="CAsvr"
TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
TestTableName="dual" URL="jdbc:oracle:thin:@gen11t-ora.db.lab.xyz.com:1530:GEN11T"/>
2. Restarted the server.
3. Ran the application and get the following error on the server console:
<Aug 22, 2011 12:39:42 AM CDT> <Error> <JDBC> <Cannot startup connection pool "C
ADConnectionPool" weblogic.common.ResourceException:
Could not create pool connection. The DBMS driver exception was:
java.lang.ArrayIndexOutOfBoundsException
at oracle.security.o3logon.C0.r(C0)
at oracle.security.o3logon.C0.l(C0)
at oracle.security.o3logon.C1.c(C1)
at oracle.security.o3logon.O3LoginClientHelper.getEPasswd(O3LoginClientH
elper)
at oracle.jdbc.ttc7.O3log.<init>(O3log.java:289)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:251)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:246)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:365)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
nectionEnvFactory.java:193)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
nectionEnvFactory.java:134)
at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
cator.java:705)
at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
ava:282)
at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
ava:650)
at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:360)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
loymentTarget.java:285)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
ments(DeploymentTarget.java:239)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
DeploymentTarget.java:199)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
57)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
25)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy31.updateDeployments(Unknown Source)
at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
yments(ServerMBean_CachingStub.java:2977)
at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
er(ApplicationManager.java:372)
at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
nManager.java:160)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
57)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
25)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy42.start(Unknown Source)
at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
.start(ApplicationManagerMBean_CachingStub.java:480)
at weblogic.management.Admin.startApplicationManager(Admin.java:1234)
at weblogic.management.Admin.finish(Admin.java:644)
at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:524)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:207)
at weblogic.Server.main(Server.java:35)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
nectionEnvFactory.java:209)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
nectionEnvFactory.java:134)
at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
cator.java:705)
at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
ava:282)
at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
ava:650)
at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:360)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
loymentTarget.java:285)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
ments(DeploymentTarget.java:239)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
DeploymentTarget.java:199)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
57)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
25)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy31.updateDeployments(Unknown Source)
at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
yments(ServerMBean_CachingStub.java:2977)
at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
er(ApplicationManager.java:372)
at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
nManager.java:160)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
57)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
25)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy42.start(Unknown Source)
at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
.start(ApplicationManagerMBean_CachingStub.java:480)
at weblogic.management.Admin.startApplicationManager(Admin.java:1234)
at weblogic.management.Admin.finish(Admin.java:644)
at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:524)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:207)
at weblogic.Server.main(Server.java:35)
Can't load scjd12.dll, file not found java.library.path=C:\jdk1.3.1_11\bin;.;C:\WINDOWS\system32;C:\WINDOWS;.\bin;C:\P
rogram Files\Lotus\Notes\Data;C:\Program Files\Lotus\Notes;C:\Program Files\Java
\jre1.5.0_17\bin;C:\Program Files\Java\j2re1.4.2_06\bin;C:\Oracle\bin;C:\Program
Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\sys
tem32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32\nls;C:\WINDOWS\sys
tem32\nls\ENGLISH;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Rational
\common;C:\Program Files\Rational\ClearCase\bin;C:\apache-ant-1.6.5\bin;C:\jdk1.
3.1_11\bin;C:\Program Files\Citrix\ICAService\;C:\Program Files\Citrix\System32\
;Z:.
<Aug 22, 2011 12:38:06 AM CDT> <Info> <JDBC> <Sleeping in createResource()>
<Aug 22, 2011 12:38:07 AM CDT> <Error> <JDBC> <Cannot startup connection pool "c
ispool" weblogic.common.ResourceException:
Could not load 'com.neon.jdbc.Driver
If this is a type-4 JDBC driver, it could occur if the JDBC
driver is not in the system CLASSPATH.
If this is a type-2 JDBC driver, it may also indicate that
the Driver native layers(DBMS client lib or driver DLL)
have not been installed properly on your system
or in your PATH environment variable.
This is most likely caused by one of the following:
1. The native layer SO, SL, or DLL could not be found.
2. The file permissions on the native layer SO, SL, or DLL
have not been set properly.
3. The native layer SO, SL, or DLL exists, but is either
invalid or corrupted.
For more information, read the installation documentation
for your JDBC Driver, available from:
http://e-docs.bea.com
at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection(Con
nectionEnvFactory.java:212)
at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(Con
nectionEnvFactory.java:134)
at weblogic.common.internal.ResourceAllocator.makeResources(ResourceAllo
cator.java:705)
at weblogic.common.internal.ResourceAllocator.<init>(ResourceAllocator.j
ava:282)
at weblogic.jdbc.common.internal.ConnectionPool.startup(ConnectionPool.j
ava:650)
at weblogic.jdbc.common.JDBCService.addDeployment(JDBCService.java:107)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(Depl
oymentTarget.java:360)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(Dep
loymentTarget.java:285)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeploy
ments(DeploymentTarget.java:239)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(
DeploymentTarget.java:199)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
57)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
25)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy31.updateDeployments(Unknown Source)
at weblogic.management.configuration.ServerMBean_CachingStub.updateDeplo
yments(ServerMBean_CachingStub.java:2977)
at weblogic.management.mbeans.custom.ApplicationManager.startConfigManag
er(ApplicationManager.java:372)
at weblogic.management.mbeans.custom.ApplicationManager.start(Applicatio
nManager.java:160)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMB
eanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl
.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(Configurat
ionMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
57)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
25)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy42.start(Unknown Source)
at weblogic.management.configuration.ApplicationManagerMBean_CachingStub
.start(ApplicationManagerMBean_CachingStub.java:480)
at weblogic.management.Admin.startApplicationManager(Admin.java:1234)
at weblogic.management.Admin.finish(Admin.java:644)
at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:524)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:207)
at weblogic.Server.main(Server.java:35)
Would like some help on this asap as the project is in critical stage.
ThanksThe driver being used by your weblogic is too old and incompatible with the DBMS. Upgrade the driver.
-
HELP! Jdbc connection to oracle ClassNotFoundException classpath issues..
Okay I am a newbie to this but all the other posts concerning this just say add the classes12.jar to my classpath.
I am using websphere 5.0
connecting to a 9i db.
after trying to find out what my classpath is ( websphere 5.0 makes it difficult to see it) i found this:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="var"
path="SERVERJDK_50_PLUGINDIR/jre/lib/rt.jar"
rootpath="SERVERJDK_SRCROOT" sourcepath="SERVERJDK_50_PLUGINDIR/src.jar"/>
<classpathentry kind="src" path="Java Source"/>
<classpathentry kind="var" path="WAS_50_PLUGINDIR/lib/j2ee.jar"/>
<classpathentry kind="var" path="WAS_50_PLUGINDIR/lib/servletevent.jar"/>
<classpathentry kind="var" path="WAS_50_PLUGINDIR/lib/ivjejb35.jar"/>
<classpathentry kind="var" path="WAS_50_PLUGINDIR/lib/runtime.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/string.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/jaxen-full.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/utility.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/jspsql.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/xercesImpl.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/xalan.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/datetime.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/mailer.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/dom.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/jstl.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/standard.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/jdbc2_0-stdext.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/saxpath.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/sax.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/dbbeans.jar"/>
<classpathentry kind="lib" path="Web Content/WEB-INF/lib/jaxp-api.jar"/>
<classpathentry kind="lib" path="C:/oracle/ora92/jdbc/lib/classes12.jar"/>
<classpathentry kind="output" path="Web Content\WEB-INF\classes"/>
</classpath>
to me it looks like it is in my classpath.. (if thats what this is).
I have imported the classes12.jar file several times through out my project to no avail.
the error i get it here:
Error: It Screwed up agian java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
SystemOut O Connecting ... cisinv
Error: java.sql.SQLException: No suitable driver
SystemErr R Exception: null
from this code:
package Business;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
* @author jeffreak
* To change this generated comment edit the template variable "typecomment":
* Window>Preferences>Java>Templates.
* To enable and disable the creation of type comments go to
* Window>Preferences>Java>Code Generation.
public class beanDbConnect {
* Constructor for beanDbConnect.
public beanDbConnect() {
super();
private Connection con = null;
private Statement cmd = null;
private ResultSet rs = null;
public Connection connect()
//Declare variable
boolean blnSuccessfulOpen = false;
Driver driver;
String driverName;
String serverAddress;
//Begin try block
try
//Load JdbcOdbcDriver
driverName = "oracle.jdbc.driver.OracleDriver";
//oracle.jdbc.driver.OracleDriver
System.out.println("Loading ..." + driverName);
//try{
Class.forName(driverName).newInstance();
//catch (Exception err)
// System.err.println("Error: new instance: " + err.toString());
System.out.println("Database loaded successfully");
//catch (ClassNotFoundException e)
catch (Exception e)
System.err.println("Error: It Screwed up agian " + e.toString());
blnSuccessfulOpen = false;
try
//Instantiate connection to bean-defined DSN
//serverAddress = ("jdbc:oracle:thin:scott/tiger@localhost:1243:" + dbInstance);
System.out.println("Connecting ... " );
String serverName = "**********";//changed for post
String portNumber = "1521";
String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + "cisinv";
con = DriverManager.getConnection(url, "scott", "tiger");
System.out.println("Ready.");
blnSuccessfulOpen = true;
catch (SQLException e)
System.err.println("Error: " + e.toString());
//End try block
return con;
}//end connect()
Please help. ive been working on it for days =(.If you're running a Web app, put all JARs that your app needs in the WEB-INF/lib directory. That's always in the CLASSPATH.
I don't know WebSphere. Do you really have to edit something to add all those CLASSPATH entries?
In Tomcat, all I'd have to do is put a WAR file in the webapps directory.
Your code needs some work. You're not following Sun's Java coding standards. Capitalize your class name, for starters.
Is the username and password for your database still "scott" and "tiger"? Nice security there.
Your connect method makes a database connection. Do you leave it to users to close it? (You do close your connections when you're done with them, don't you?)
I'd make Connection a data member and create it in a constructor. I'd write a close method to close it up.
Doesn't WebSphere do connection pooling? Do you really want to write your own class to handle this?
MOD -
JDBC connection to Oracle 10g RAC periodically times out
I've been banging my head against the wall for months now and can't figure out why this is and what's causing it.
We have 6x CF8 servers in our environment. 3 of which work perfectly and the other 3 have the following problem. All 6 machines were installed at the same time and followed the exact same installation plan.
When I configure Oracle RAC data source, some of the machines time-out connecting to Oracle from time-to-time.
Config:
Solaris 9 on both CF and Oracle
CF8 Enterprise with the latest updater.
Apache 2 (not that it's relevant)
6 machines, load-balanced (not clustered), identical install and configuration.
data source config:
JDBC URL: jdbc:macromedia:oracle://10.0.0.3:1521;serviceName=dbname.ourdomain.com;AlternateServers= (10.0.0.4:1521);LoadBalancing=true
DRIVER CLASS: macromedia.jdbc.MacromediaDriver
The problem:
Every few minutes, CF starts hanging requests that deal with a specific RAC only data source. After about 30 seconds, all requests bail and generate this error in cfserver.log:
A non-SQL error occurred while requesting a connection from dbsource.
Timed out trying to establish connection
This happens with any RAC data source on the "bad" servers while the "good" servers don't have this problem. The "bad" server doesn't have any problems with direct (non-rac) Oracle data source.
Already tried:
Moving server connections around on a switch (rulling out bad switch port)
Copying driver from the healthy server (but it's the same installer anyway)
Changed from RAC to normal Oracle type data source - works perfectly. So at the moment I have 3 servers connecting to a specific oracle instance and the other 3 connecting to RAC.
Tried googling and searching forums and even Oracle metalink - nothing I could see relevant to this.
It's a shame that after spending a ton of money on CF8 upgrades and Oracle RAC, we can't really utilize fail-over on the database connection.
Any takers?
Thanks,
HenryI have the following in my CLASSPATH:
C:\Ora10g1\product\10.2.0\db_1\jdbc\lib\jdbc.jar;
C:\Ora10g1\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar;
C:\Ora10g1\product\10.2.0\db_1\jlib\jndi.jar;
C:\Ora10g1\product\10.2.0\db_1\jlib\orai18n.jar;
Still 'Cannot find type 'oracle.jdbc.pool.OracleDataSource'
Thanks -
JDBC connection to Oracle 8.16 from Weblogic 6.1
I am trying to connect to an Oracle DB using the JDBC thin driver to Weblogic 6.1
I am getting the following error when starting up the Weblogic server:
"oracle.net.TNSAddress.SOException"
Anyone have an idea as to why I am getting this.
Thanks
Lathell McKellerIf the url fix does not work - try updating your jdbc drivers for oracle 8 (get the latest one). There is a chance that using the older oracle 7 drivers you might encounter some problems.
Regards,
Michael Bogecho -
Problem in jdbc connect thru oracle
hi all
i hv installed oracle 8i on win2k
i wanna connect thru jdbc
but i am getting error below
i donno whr i got struck?
plz help me
thnx in advance
bye
////////// details ///////////////////////
import java.sql.*;
///win2000,oracle 8i
/// try to fix whr i hv done mistake
import java.io.*;
class JDBC1
public static void main(String[] args)
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver ");
//// i tried all below connections
Connection cn=DriverManager.getConnection("jdbc:odbc:santhu:PLSExtProc","scott","tiger"); /// oracle_sid=santhu hv given
//Connection cn= DriverManager.getConnection("jdbc:odbc:PLSExtProc","scott","tiger"); /// PLSExtProc it is given in tnsnames.ora file
//Connection cn=DriverManager.getConnection("jdbc:odbc:oracle:PLSExtProc","scott","tiger"); /// driver name i hv given as oracle and one more as santhu--both for oracle driver
Statement st=cn.createStatement();
ResultSet rs=st.executeQuery("select * from dept");
int dno;
String dname;
while(rs.next())
dno=rs.getInt("deptno");
dname=rs.getString("dname");
System.out.println(dno+dname);
catch(Exception e)
System.out.println(e);
/// compiled successfully
/// but runtime error::SQLException---data source name not found no default driver specified
//// saying tns-12538 error
/// tnsping-----error is coming.........
/// lsnrctl start --------is not working
//// lsnrctl status ------is also not working
/// in services i hv set oraclelistener to auotmatic start
/// in net8 configuration assistent everything is ok
/// try to do it today...ok na
// i put classpath to home dir of oracle
///////////listener.ora file //////////////////////////////
# LISTENER.ORA Network Configuration File: D:\Oracle\Ora81\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = Vaman)(PORT = 1521))
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vaman)(PORT = 2481))
(PROTOCOL_STACK =
(PRESENTATION = GIOP)
(SESSION = RAW)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\Oracle\Ora81)
(PROGRAM = extproc)
(SID_DESC =
(GLOBAL_DBNAME = santhu)
(ORACLE_HOME = D:\Oracle\Ora81)
(SID_NAME = santhu)
/////////////////tnsnames.ora file///////////////////
# LISTENER.ORA Network Configuration File: D:\Oracle\Ora81\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = Vaman)(PORT = 1521))
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vaman)(PORT = 2481))
(PROTOCOL_STACK =
(PRESENTATION = GIOP)
(SESSION = RAW)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\Oracle\Ora81)
(PROGRAM = extproc)
(SID_DESC =
(GLOBAL_DBNAME = santhu)
(ORACLE_HOME = D:\Oracle\Ora81)
(SID_NAME = santhu)
////////////////////////////////////////////////Class.forName("oracle.jdbc.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@<hostname>:1521:<database name>", "scott", "tiger");
You can find OracleDriver in classes12.jar (<ORA_HOME>/jdbc).
Check your tnsnames.ora file for <hostname> and <database name>. For example, if you had a following entry in tnsnames.ora file:
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = SOMEHOST)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
you would write:
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@SOMEHOST:1521:XE", "scott", "tiger"); -
Configuring RAC-aware JDBC connection in Oracle SQL Developer?
How can Oracle SQL Developer be configured to properly connect to an [Oracle RAC|http://en.wikipedia.org/wiki/Oracle_RAC] environment, I.E., not just setup to always connect to one of the individual nodes?
[http://programmersjournal.blogspot.com/2008/08/jdbc-connection-string-for-oracle-rac.html] has an example of a classic and the equivalent RAC-aware version of a JDBC connection string. I've already been using a RAC connection string of the same format from within custom Java applications without issue. I thought the same should be configurable in Oracle SQL Developer by setting the "Connection Type" drop-down to "Advanced", then entering the RAC-aware JDBC connection string as the "Custom JDBC URL". However, upon testing the connection, the following error is displayed at the bottom of the dialog:
Status : Failure -Test failed: Io exception: NL Exception was generated
There is no additional information shown on the "Logging Page" view. Using Oracle SQL Developer 1.5.5.
Thanks!Thanks, Barry. Just F.Y.I., it is working for me now that I upgraded to the 2.1 EA as -K- suggested. I had marked his reply as "Correct", but probably should have left a response indicating my success as well.
Now, if there's anything you could do regarding the [issues around the display performance of CLOBs, etc., in the Query Result view|http://forums.oracle.com/forums/message.jspa?messageID=3906571] , it'd be very appreciated! -
JDBC Connectivity to Oracle 8i Database
I'am facing problem in connecting to Oracle 8i server using oci8 JDBC driver provided by Oracle.
The statemnet that gives me error is --
Connection conn = DriverManager.getConnection ("jdbc:oracle:oci8:@" + "MIS", "scott", "tiger");
This throws an exception
java.lang.UnsatisfiedLinkError : make_c_state.
Can anyone please tell me where i'am going wrong?
Thanx in advanceReally need to know the platform on which you're trying to execute the code. Each client will need to have the standard Oracle client software installed (with the NET8 configuration application, which provides the 'drivers')
On Oracle's metalink see some responses
http://metalink.oracle.com/metalink/plsql/ml2_documents.showFrameDocument?p_database_id=NOT&p_id=121922.1
Overview
This example provides a minimal test program used to verify that the client
environment is set up properly for running the JDBC OCI driver in order to avoid
receiving the 'unsatisfied link error' caused by an incorrect LD_LIBRARY_PATH.
Program Notes
Simply copy the code below to a file called Test.java. Compile and run the
file from the client environment that you intend to use for your JDBC
applications.
References
[NOTE:118756.1]
Caution
The sample program in this article is provided for educational purposes only
and is NOT supported by Oracle Support Services. It has been tested
internally, however, and works as documented. We do not guarantee that it
will work for you, so be sure to test it in your environment before relying
on it.
Program
- - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - - - - - -
public class Test {
public static void main (String [] args)
try
System.loadLibrary("ocijdbc8");
System.out.println("Successfully Loaded");
} catch(Exception e)
System.out.println("LD_LIBRARY_PATH is not properly set");
e.printStackTrace();
- - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - - - - - -
http://metalink.oracle.com/metalink/plsql/ml2_documents.showFrameDocument?p_database_id=NOT&p_id=118756.1
which is:
I'm getting Unsatisfied Link Error with Oci 8 Driver ?
First, make sure that the jdbc-oci shared object (libocijdbc8 or liboci80Xjdbc.so etc.) and ${ORACLE_HOME}/lib are in your path. Then, try this Sample Program. Some times, even after the shared object is loaded successfully, you may get errors such as make_c_state symbol not found. This may happen if your CLASSPATH has classes.zip from JRE 1.1.7 or JDK 1.1.6 and your running java binaries from jdk 1.1.3 or so. Make sure everything (LD_LIBRARY_PATH, CLASSPATH, java binaries) is in SYNC.
Maybe you are looking for
-
How to get Portal User Context in Web Dynpro application
I have successfully integrate a web dynpro app into SAP Netweaver Portal. Within my web dynpro app, how can I get portal user context information such as first name, last name, job title or some newly created ume attibutes. Is there any programmatica
-
I am running on a Core i7 iMac with 20GB or RAM and have already done the two applicable steps in the main Adobe help area relating to Switchboard (Error: Waiting for Bridge | Mini Bridge panel) to no avail. Any ideas?
-
Error using ORA_FFI.REGISTER_PARAMETER
Hi all , I am using forms 11gr2. I an using ORA_FFI built-in in my code. I am able to load library and register a function. I am also able to register the parameters if the number of parameters is less than 30. The code is working fine in 6i. if i am
-
JPopupMenu won't disappear after using it!
I'm using a JPopupMenu on a JTable. When I rightclick on a line in my table, I display a dialogbox to make some selections which you can close by clicking an OK button. The problem is, that when I close the dialog box the JPopupMenu won't go away. Mo
-
Time Capsule - Create a new network or join existing?
Hello Folks, So I got my new 2TB Time Capsule and I was reading through the discussion forum on how to set thip up. I already have wifi in my home and I was wondering if it would be a good idea to connect the TC to the existing wifi network or create