Skip to Main Content

Application Development Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem JDBC Connection using OCI Driver on Weblogic Portal on Linux

701213Oct 23 2009 — edited Oct 23 2009
Hi Team,

I want a JDBC connection using OCI Driver in Weblogic Portal 8.1 sp4 on Linux. When I had tested using JDBC connection using Plain Java Code it is working. Also when I create the OCI Connection Weblogic Connection Pool it is working.

But My Requirement is to create the connection using Java Code in Portal Application

But When I create OCI connection in the code it is throwing NO SUITABLE DRIVER Found.

---------- Code in Plain Java Code ------------ Same code is used in Weblogic Portal Application --------------------------------

public static void main(String[] args) throws Exception{
Class.forName("oracle.jdbc.driver.OracleDriver");
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

String url="jdbc:oracle:oci8:@TESTDB";
Properties props = new Properties();
props.put("user","scott");
props.put("password","tiger");

conn=DriverManager.getConnection(url,props);


}

--------------------------------------------------------------

When I am using the same code in Weblogic Portal and Deployed on Weblogic Portal Server 8.1 SP4 it is throwing following error.

-------------- Exception on Server Log --------------------

java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(Ljava.lang.String;Ljava.util.Properties;Ljava.lang.ClassLoader;)Ljava.sql.Connection;(Unknown Source)
at java.sql.DriverManager.getConnection(Ljava.lang.String;Ljava.util.Properties;)Ljava.sql.Connection;(Unknown Source)

----------------------------------------------------------------

My Environment is

----------------------------------------------------------

LINUX
Weblogic 8.1 SP4
Oracle 9i Client on Same Machine

Oracle 10g Server on Different Machine

---------------------------------------------------------------------

My Environment Variables on the Linux Server also set properly as following

------------------------------------------

PATH=/apps/pmaaum/ant/apache-ant-1.6.5/bin:.:/apps/beahomedev/jdk142_05/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/apps/oracle/ora9i/product/9.2.0/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/apps/oracle/ora9i/bin

LD_LIBRARY_PATH=/usr/lib:/apps/oracle/ora9i/product/9.2.0/lib:/apps/oracle/ora9i/product/9.2.0/lib32:/apps/oracle/ora9i/product/9.2.0/rdbms/lib:/usr/openwin/lib:/apps/oracle/ora9i/product/9.2.0/jdbc/lib

JAVA_HOME=/apps/beahomedev/jdk142_05

JDBC_LIB=/apps/oracle/ora9i/product/9.2.0/jdbc/lib

CLASSPATH=:.:/apps/beahomedev/jdk142_05/lib/rt.jar:/apps/oracle/ora9i/product/9.2.0/jdbc/lib/classes12.jar

----------------------------------------------

Please help me, Let me know if you required anything.


Thanks in Advance
Vishnu

Edited by: vishnuk on Oct 23, 2009 4:07 AM

Edited by: vishnuk on Oct 23, 2009 4:10 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 20 2009
Added on Oct 23 2009
1 comment
1,397 views