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
Andrew
Class.forName ("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@hostname:port:SSID", "user", "password");
Similar Messages
-
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 -
How to connect to personal oracle using oracle thin driver on windows98
Hi,
i would like to know is it possible to connect to personal oracle8 using oracle thin driver on windows98.iam getting some exceptions when iam running ,could any one help me
1.exception in thread main java.sqlexception:IOexception:the
networkadapter could not establish the connection
2.at oracle.jdbc.dbaccess.DBError.throws sqlexception(DBError.java)
3.atoracle.jdbc.dbaccess.DBError.throws sqlexception(DBError.java)
4.atoracle.jdbc.driver.oracleconnection.<init>(oracleconnection.java)
5.atoracle.jdbc.driver.oracledriver.getconnectioninstance(oracledrive
r.jva)
6.atoracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
7.atjava.sql.DriverManager.getConnection(unknown source)
8.atjava.sql.DriverManager.getConnection(unknown source)
9.at JEmp.main(JEmp.java:16)
nullhttp://www.orafaq.com/wiki/JDBC#Thin_driver
-
Hi,
I have a problem in using oracle thin driver,ive downloaded oracle thin driver and classpath has been set for classes12.zip.Iam trying to connect to server:teams sid:teams .
the following code compiles and throws error @ runtime
************************ code****************8
import java.sql.*;
public class ocdtest {
public static void main(String arg[]){
try {
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@teams:1521:teams", "raghu", "startoracle");
Statement stmt = conn.createStatement ();
ResultSet rset = stmt.executeQuery ("select login_name from login");
while (rset.next ()){
System.out.println (rset.getString ("login_name"));
}catch(Exception e){
System.out.println(e);
********************* code *********************************
********************** Exception *************************
Exception in thread "main" java.lang.UnsatisfiedLinkError: get_env_handle
at oracle.jdbc.oci8.OCIEnv.get_env_handle(Native Method)
at oracle.jdbc.oci8.OCIEnv.getEnvHandle(OCIEnv.java:70)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:359)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:252)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:365)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:172)
at ocdtest.main(ocdtest.java:11)
*******************************Exception **********************
can anyone help me how to solve this problem.
thanks in advance
karthikHi,
The following code works
import java.sql.*;
public class ocdtest {
public static void main(String arg[]){
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@teams:1521:teams", "raghu", "startoracle");
Statement s=con.createStatement();
System.out.println("connected");
ResultSet rs=s.executeQuery("select login_name from login where login_name='tom'");
System.out.println("resultset");
while(rs.next()){
System.out.println(rs.getString("login_name"));
}catch(Exception e){
System.out.println(e);
all u need to download is classes12.zip and the patch for this zip .
thanks and regards
Karthik -
Error in creating Connection Pool using Oracle Thin Driver
Hi,
I am trying to create a connection pool in WS 5.1 with sp #6 using Oracle Thin Driver (oracle.jdbc.driver.OracleDriver) on a Sun box. But I am able to create the pool using weblogic.jdbc.oci.Driver. I get an DBMS Driver exception when I use thin driver. I have LD library path and weblogic class path set correctly. WL shows the following exception :
weblogic.common.ResourceException: weblogic.common.ResourceException:
Could not create pool connection. The DBMS driver exception was:
java.sql.SQLException: Io exception: The Network Adapter could not establish the
connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
Any help on this is greatly appreciated.
Thanks,
RamuHi Ramu,
Please post your connection pool setting here. You might have missed some
port/server info. The driver is unable to connect to the db server here.
sree
"Ramu" <[email protected]> wrote in message
news:3d5bbc3a$[email protected]..
>
Yes. I am trying to create a connection pool in weblogic and I have theweblogic
class path setup correctly. It points to classes111.zip andnls_charset11.zip.
>
-Ramu
"Neo Gigs" <[email protected]> wrote:
Did you setup the JDBC library classpath correctly?
For me, e.g. Oracle 7.3.4, the classpath should be:
export CLASSPATH = /oracle7.3.4/jdbc/lib/classes.zip:%CLASSPATH%
Noted that the JDBC classpath must be the first classpath element in
the export
statement.
Neo -
Using oracle thin driver from Weblogic server 6.1
Hi
I need to know which driver is best for establishing JDBC Connection i.e.
whether to use JDriver provided with Weblogic or to go using Oracle thin driver.
Can some one tell the detailed procedure involved in configuring oracle thin driver
in Weblogicserver 6.1.
Thanks in advance,
S GopikrishnaI would recommend using the thin driver where ever possible, their are
certain problems with thin driver which are more in the area of XA support
you can check weblogic documentation for pointers on this. Oracles latest
thin driver is pretty stable as they have fixed a bunch of problems.
heres how to use thin driver:
create the connection pool using the following url
jdbc:oracle:thin:@<mc-name or ip-address>:<port-no>:<oracle sid>
and driver: oracle.jdbc.driver.OracleDriver
You dont have to install the thin driver its bundled with the product.
hth
sree
"S Gopikrishna" <[email protected]> wrote in message
news:3c34a0e5$[email protected]..
Hi
I need to know which driver is best for establishing JDBC Connection
i.e.
whether to use JDriver provided with Weblogic or to go using Oracle thin
driver.
Can some one tell the detailed procedure involved in configuring oracle thin
driver
in Weblogicserver 6.1.
Thanks in advance,
S Gopikrishna -
How to set oracle thin driver for jdbc2.0 in WLS6.1?
I want to use oracle thin driver for jdbc2.0 in WLS6.1.
I just set it like what it look in jdbc1.2.
In my code, I import the classes under package oracle.sql.* and oracle.jdbc.*.
When I cast the connection from (DataSource)ctx.lookup("myPool").getConnection();
to oracle.jdbc.OracleConnection,
it raise the exception java.lang.ClassCastException: weblogic.jdbc.rmi.SerialConnection.
Can any one tell me how to solve it? ThanksHi Andy,
You can not cast a connection returned from datasource
to oracle.jdbc.OracleConnection as it's a kind of an RMI
stub thus has nothing to do with oracle. Could you tell us
what you're going to acomplish? We'll try to offer a solution.
Regards,
Slava Imeshev
"Andy Qiu" <[email protected]> wrote in message
news:3d74787c$[email protected]..
>
I want to use oracle thin driver for jdbc2.0 in WLS6.1.
I just set it like what it look in jdbc1.2.
In my code, I import the classes under package oracle.sql.* andoracle.jdbc.*.
When I cast the connection from(DataSource)ctx.lookup("myPool").getConnection();
to oracle.jdbc.OracleConnection,
it raise the exception java.lang.ClassCastException:weblogic.jdbc.rmi.SerialConnection.
Can any one tell me how to solve it? Thanks -
Using oracle thin driver with to_char gives invalid column name
select x,y,z, to_char(event_time,'YYYY-MMM-DD') from eventtable;
if i execute the above query using oracle thin driver it gives me invalid column name. It works fine if i use weblogic driver. So what could be the problem ???
thanks.Sorry , forgot to add that 'YYYY-MM-DD' or 'YYYY-Month-DD' or 'Year-MM-DD' or 'Year-Month-DD' are also allowed(please cheek also for other combinations), not 'YYYY-MMM-DD'.
Thanks -
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? -
GUYS!! Is there any way to write BLOB's 4K using Oracle thin driver
I've been trying for 3 days to do that but nothing worked ...
Not
setBinaryStream(x, new ByteArrayInputStream(anArrayWith10KBytes), anArrayWith10KBytes);
nor setBytes(x, myArray), or setObject(x, myArray).
Is there any way to store Blobs to Oracle 8.1.6 using the thin driver ????????????
Please help ... cause I really need it !!!
Best regards,
StefigHi Stefig
Following code help you to store the files >4k in BLOB column in Oracle database
test is a table in which TEST is BLOB column
String url = "jdbc:oracle:thin:@.....";
String user = "user name";
String password = "password";
Connection conn = null;
PreparedStatement aQuery = null;
ResultSet rs = null;
try
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection(url,user,password);
conn.setAutoCommit(false);
Statement stmt = conn.createStatement();
stmt.execute("insert into test values (EMPTY_BLOB())");
rs = stmt.executeQuery("select TEST from test");
rs.next();
BLOB blob =((OracleResultSet)rs).getBLOB(1);
File f = new File(filename);
FileInputStream io = new FileInputStream(f);
OutputStream os = blob.getBinaryOutputStream();
int size = io.available();
byte[] buffer = new byte[1024];
int length=0;
while((length=io.read(buffer)) != -1)
os.write(buffer,0,length);
io.close();
os.close();
stmt.execute("commit");
catch()
Good Luck
From
Sachin -
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.
% -
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. -
Memory leak using Oracle thin driver on wls6.1...
Hi, I've been attempting to find a memory leak in an application that
runs on WLS 6.1 SP2, on Solaris 8 and accessing an Oracle 9i db. We
are using the Type 4 (Thin) driver and JProbe reports that hundreds of
oracle.jdbc.* objects are left on the heap after my test case
completes. Specifically oracle.jdbc.ttc7.TTCItem is the most common
loiterer on the heap. I have verified that after each database access
the resources are release correctly (i.e. ResultSet, Connection,
PreparedStatement, etc.)
Has anyone encountered similar problems? or does anyone know how to
fix this?
Thanks,
Tim WatsonHi Tim!
We have seen problem using oracle 817 client that has been resolved using
901 client for type2(oci) driver, But i am not aware of thin driver
problem. You should check with oracle if they have find any customer's
with this problem.
Thanks,
Mitesh
Tim Watson wrote:
Hi, I've been attempting to find a memory leak in an application that
runs on WLS 6.1 SP2, on Solaris 8 and accessing an Oracle 9i db. We
are using the Type 4 (Thin) driver and JProbe reports that hundreds of
oracle.jdbc.* objects are left on the heap after my test case
completes. Specifically oracle.jdbc.ttc7.TTCItem is the most common
loiterer on the heap. I have verified that after each database access
the resources are release correctly (i.e. ResultSet, Connection,
PreparedStatement, etc.)
Has anyone encountered similar problems? or does anyone know how to
fix this?
Thanks,
Tim Watson -
How to use Oracle jdbc driver fixedString property?
Oracle pads values in char columns so if I insert "a" in a CHAR(2) column then I cannot get that record by comparing that column to "a", I should get it by comparing it to "a ". Right?
To solve this problem the Oracle jdbc driver has the property fixedString but I cannot make it work. (look for fixedString here )
I'm using ojdbc14.jar driver for Oracle 10gR2 and accessing an Oracle 10gR2 database.
This is my code:
try {
Properties props = new Properties();
props.put("user", "****");
props.put("password", "****");
props.put("fixedString", true);
Class.forName("oracle.jdbc.driver.OracleDriver");
String jdbcUrl = "jdbc:oracle:thin:@<host>:<port>:<sid>";
Connection connection = DriverManager.getConnection(jdbcUrl, props);
PreparedStatement ps = connection.prepareStatement(
"SELECT * FROM MY_TABLE WHERE MY_TABLE_ID = ?");
ps.setObject(1, "abc"); // (*)
// MY_TABLE_ID is CHAR(15)
ResultSet rs = ps.executeQuery();
while (rs.next())
System.out.print("data: ");
System.out.println(rs.getString("MY_TABLE_ID"));
rs.close();
ps.close();
connection.close();
} catch (SQLException ex) {
ex.printStackTrace();
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
The above code executes fine (no exceptions thrown) but the ResultSet is empty after executeQuery().
If I change the line (*) for
ps.setObject(1, "abc ");
Then I get the column I wanted. So it seems the driver is ignoring the fixedString option.
I've also tried changing the line (*) for
ps.setObject(1, "abc", java.sql.Types.CHAR);
But the ResultSet I get is empty again. What am I missing?
Thanks in advanceEs un Bug se corrige en la versión del OAS 10.1.2.3
Bug 10222534: UNABLE TO SET FIXEDSTRING PROPERTY IN DATASOURCE
Maybe you are looking for
-
Borders and shading, Move all objects at once!
*Hi all, hope every1's good!! I hope someone can help me with this problem!, a friend has asked me to do a thank you card for him cos his hosting a dinner party for his work colleagues, now i know that pages 08 can do this because i've checked and st
-
Hi Experts, Currently I am working on BI 7.0. Here is the scenario, Actually I want a such setting so I can delete the previous Info Cube request while scheduling info package for new request. Actually in 3.0 we had this functionality in Info package
-
Storing LOBs in ASSM tablespace
Hello, I'd like to know if a lob (clob, nlob, etc). can be stored in an ASSM (automatic segment space management) tablespace in Oracle 10g R1. Thanks! Gabriel.
-
I was nervous when updating to 6 - but it worked! I was one of the ones who had a 'mare with the 5 update (lost 1/2 my music collection, took over a day to sort out, ended up going back to 4.9 etc). Butt this time, I tuned off antispyware, and virus
-
How do i print from my mac book using printer connected to my Imac
I am trying to print from my Mac book by using the printer connected to my Imac however i keep getting a notice which says Authentication required.what am i missing? I set them up to share printing but something is wrong