COnfiguring oracle JDBC Driver with Web Sphere
I have oracle 7.3.4(on Solaris) and IBM Web Sphere standard
Edition 2.03 (on NT) I want connect to Oracle ina Servlet. Can
any one help in configuring Oracle JDBC driver in Web
Sphere?
Thanks very much
Tom
null
I have oracle 7.3.4(on Solaris) and IBM Web Sphere standard
Edition 2.03 (on NT) I want connect to Oracle ina Servlet. Can
any one help in configuring Oracle JDBC driver in Web
Sphere?
Thanks very much
Tom
null
Similar Messages
-
Oracle jdbc driver with debug capability
I have been using MagicDraw UML to reverse engineer DDL and UML classes from Oracle databases. I recently loaded some public domain hydrology data using FEM, a geophysical data translation tool. After doing this, I get:
Parsing failed (Oracle - sample) ORA-00942: table or view does not exist
registerDriver: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@331fd8]
skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@93068a]
skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@f18070]
skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@17b9223]
skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@107eafc]
skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@f2a824]
skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@53d29b]
skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@27d525]
skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@15d84e0]
skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@792357]
skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@1f92ac0]
skipping: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@517dc]
Oracle Jdbc tracing is not avaliable in a non-debug zip/jar file
SQLException: SQLState(42000) vendor code(942)
MagicDraw support has suggested that I use jar or zip that provides debug capability. Where can I find such a driver?In the Downloads section, there are the regular JDBC drivers (i.e. ojdbc14.zip) and the debug JDBC drivers (i.e. ojdbc14_g.zip).
Justin
Distributed Database Consulting, Inc.
www.ddbcinc.com/askDDBC -
Use of oracle.jdbc.driver now deprecated.
Hi all,
Just thought of sharing this note with us.,(if its new ..)
http://otn.oracle.com/docs/products/oracle9i/doc_library/901_doc/java.901/a90211/overvw.htm#1008871
Extract ...,
Beginning in Oracle9i, the Oracle extensions to JDBC are captured in the package oracle.jdbc. This package contains classes and interfaces that specify the
Oracle extensions in a manner similar to the way the classes and interfaces in java.sql specify the public JDBC API.
Your code should use the package oracle.jdbc instead of the package oracle.jdbc.driver used in earlier versions of Oracle. Use of the package
oracle.jdbc.driver is now deprecated, but will continue to be supported for backwards compatibility.
All that is required to covert your code is to replace "oracle.jdbc.driver" with "oracle.jdbc" in the source and recompile. This cannot be done piece-wise.
You must convert all classes and interfaces that are referenced by an application. Conversion is not required, but is highly recommended. Future releases of Oracle
may have features that are incompatible with use of the package oracle.jdbc.driver.
The purpose of this change is to enable the Oracle JDBC drivers to have multiple implementations. In all releases up to and including Oracle9i, all of the Oracle
JDBC drivers have used the same top level implementation classes, the classes in the package oracle.jdbc.driver. By converting your code to use
oracle.jdbc, you will be able to take advantage of future enhancements that use different implementation classes. There are no such enhancements in Oracle9i, but
there are plans for such enhancements in the future.
Regards
Elango.The two main things that would have to change
- driver : com.microsoft.sqlserver.jdbc.SQLServerDriver
- url: jdbc:microsoft:sqlserver://localhost:1433
It may be that this page will help you
http://msdn.microsoft.com/data/learning/jdbc/
You also need to make sure that the files Msbase.jar , Msutil.jar and Mssqlserver.jar are all available in the "classpath"
For a web app, that means these files should be in the WEB-INF/lib directory.
Good luck,
evnafets -
Adding Oracle JDBC driver to Analyzer 6.5
Hi all,We're currently trying to establish an Oracle Relational Database connection from Analyzer 6.5 (running on DB2 as repository). Unfortunately Analyzer 6.5 did not include Oracle JDBC driver with the installation (it claims it did in the docs). Does anyone know how to add the Oracle JDBC driver (classes12.zip) to Analyzer 6.5 existing installation?ThanksGerd
Never mind. I found out the solution. Turns out that we had to rename classes12.zip to classes12.jar and add it to classpath and copy it to appserver/webapps/Analyzer6_server/WEB-INF/lib.I guess this applies to all JDBC drivers.
-
Oracle JDBC driver and CF MX 7 Standard edition
hi, guys.
is it possible to use Oracle JDBC driver with CF MX 7
Standard edition?
all our CF servers are Enterprise edition so we never ran
into any
problems connecting to Oracle servers.
however, there will be a couple of new CF servers with
relatively
simple jobs running and we're trying to determine if we can
use the
Standard edition instead.
I'd like to test this on my own, but CF MX 7 Standard edition
is not
available as a trial download.
if there's someone who's done this already, I'd love to hear
from
you.
can anyone shed a little light on this?
thank you very much!
JFor the date/timestamp issue, you might check thread
Oracle
Date/Timestamp issue or
CFMX
and Oracle 10G JDBC no longer retrieves timestamp with date
Phil -
In Trouble with the Oracle JDBC Driver version - 10.1.0.5.0
Hi !
Without any problems i'm using the Oracle JDBC Driver version - 10.1.0.3.0 to access to the
Oracle database (Oracle Database 10g Release 10.2.0.1.0 - 64bit Production).
But exchanging the JDBC Driver 10.1.0.3.0 to 10.1.0.5.0 brings up the following problem:
the statement
con.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability)
(with parameters resultSetType = 1003, resultSetConcurrency = 1007, resultSetHoldability= 1)
returns null !
while using the Oracle JDBC Driver version - 10.1.0.3.0 the statement (with same parameters)
returns a correct PreparedStatement.
Every hint or idea is welcome.
Best regards,
ClausDuplicate post:
In Trouble with the Oracle JDBC Driver version - 10.1.0.5.0
Claus,
Pardon me if I am stating the obvious, but why don't you use the 10.2 JDBC driver with your 10.2 database? The driver is part of the database distribution. Otherwise, you can download the driver from the OTN Web site.
Good Luck,
Avi. -
Load oracle jdbc driver error when run applet via the web
Hi All,
I have built an applet which connect to database via jdbc thin driver. It works fine when I run it through the applet viewer, but got a problem when run it through the web.
java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
I am using jdev9i 9.0.4 and jdk 1.4.2. The jdbc version is 9.0.1
I have added both the classes12.zip and ojdbc14.zip in the class path and also pack them together with my applet class. Here is the code
public class MyApplet extends Applet
implements Runnable
public void start()
if(theThread == null)
theThread = new Thread(this);
theThread.start();
Retrieve R = new Retrieve();
this.MyMap = R.retrieveDesc();
public class Retrieve
public Retrieve()
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn=DriverManager.getConnection("jdbc:oracle:thin:@babyruth.wvu.edu:1703:devdw", User, Password);
conn.setAutoCommit(true);
connectStatus = true;
public HashMap retrieveDesc()
return map;
I have also built one HTML page NewApplet like this
<HTML>
<HEAD>
<TITLE> My New Applet</TITLE>
</HEAD>
<APPLET CODE="MyApplet.class" CODEBASE="menu" ARCHIVE="MyApplet.zip" WIDTH=300 HEIGHT=485>
<!--General Settings-->
<param name="bgcolor" value="255,255,255">
</HTML>
Any advice is highly appreciated
MeiSir,
Well you haven't "packed" them correctly. Why don't you just add the driver bits to the soucebase tag? or something like that anyway...
Sincerely,
Slappy -
Hi,
I have installed the Oracle Data Integrator Public Web Services on Apache Tomcat 5.5 application server with Apache Axis2
When I try to call the web service OdiInvoke using the operation "listScenario" using only the JdbcDriver as input parameter, the response I get back from the web service call is:
java.lang.ClassNotFoundException: Class Not found : oracle.jdbc.driver.OracleDriver
Using the operator "getWebServiceVersion" I get a successfull response back som the connection seems fine.
Obviously the error has to do with the driver not beeing available but where should I put the driver? Or how do I make it available? When working from Topology Manager, all connections are fine.
Best regards
MSolved it on my own by putting ojdbc14.jar in the following directory: <Apache-Tomcat install dir>/webapps/axis2/WEB-INF/lib/
Thought I'd share in case some one else has same issue
/M -
I am trying to set up the Oracle jdbc on Sun ONE Web Server Enterprise Edition 6.1 but do not seem to be having any luck. It seems that OCI and thin fails.
I have installed the Oracle client in the folder c:\oracle\ora92. I have selected the following items to install in the Oracle client: Oracle 9i Client 9.2.0.1.0, Common files, JDBC/OCI, JDBC/Thin, and Internet Directory Client. (I then downloaded ojdbc14.jar and placed it in jdbc\lib folder.)
I am seeing the following error: ClassNotFoundException: oracle.jdbc.driver.OracleDriver
From the following web page:
<code>
<%@page language="java"
import="java.sql.*,
oracle.jdbc.driver.*,
oracle.sql.*
"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
Hello World
</title>
</head>
<body>
<%
//connections to ops2
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:oci8:@wydot-ops2","username","password");
Statement stmt = conn.createStatement();
ResultSet rset = null;
rset = stmt.executeQuery("SELECT AGENCY_NUMID,AGENCY_NAME FROM flightsch.state_agencies ORDER BY agency_name");
while(rset.next())
String ag_name = rset.getString("agency_name");
%>
<%= ag_name%>
<%
} //end of while loop
rset.close();
stmt.close();
conn.close();
%>
</body>
</html>
</code>
I have made the following entries into the Sun One Administration pages:
Java Tab
JVM path Settings
Classpath suffix = c:\oracle\ora92\jdbc\lib
Ignore Env Class Path = on
Native Lib Path Prefix = c:\j2sdk1.4.2_02\lib
Native Lib Path Suffix =
JDBC Connection Pools
Pool = jdbc-oracle-pool
DataSource Classname = oracle.jdbc.pool.Oracle.DataSource
URL = wydot-ops2
User = username
Password = password
(Rest of items = defaults)oracle.jdbc.driver.OracleDriver is deprecated, you may be having an issue with that. Try oracle.jdbc.OracleDriver instead.
Typically you don't need to registerDriver, just load the classes:
Class.forName("oracle.jdbc.OracleDriver");
WEB-INF/lib is the correct place to place application jar files, it is part of the automatic CLASSPATH for typical containers. -
[Oracle JDBC Driver]This driver is locked for use with embedded application
Hi
I installed Sun Java Studio Enterprise 8, and am trying to connect to my Oracle database using the attached tutorial code.
The code compiles fine, but I get the following error whenever I run the file: [Oracle JDBC Driver]This driver is locked for use with embedded application
I don't understand what is happening.
Using the Runtime navigation panel on the upper left of the IDE screen, I can right-click and connect to the database, and navigate database files, using the Oracle JDBC Driver that came with JSE8.
Name: Oracle Driver
Driver: com.sun.sql.jdbc.oracle.OracleDriver
Database URL: jdbc:sun:oracle://JAZZPUP:1521;SID=REPO
If the driver is installed, and can be used to connect to a database by right-clicking on the database definition in the Runtime panel, why can't I connect to it just using java code in the IDE. I would expect both methods to work or to fail, not one of each using the same IDE.
Many thanks and take care,
Shayne
import java.sql.*;
public class CreateCoffees {
public static void main(String args[]) {
//String url = "jdbc:mySubprotocol:myDataSource";
String url = "jdbc:sun:oracle://JAZZPUP:1521;SID=REPO";
Connection con;
String createString;
createString = "create table COFFEES " +
"(COF_NAME VARCHAR(32), " +
"SUP_ID INTEGER, " +
"PRICE FLOAT, " +
"SALES INTEGER, " +
"TOTAL INTEGER)";
Statement stmt;
try {
//Class.forName("myDriver.ClassName");
Class.forName("com.sun.sql.jdbc.oracle.OracleDriver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
try {
//con = DriverManager.getConnection(url, "myLogin", "myPassword");
con = DriverManager.getConnection(url, "login", "password");
stmt = con.createStatement();
stmt.executeUpdate(createString);
stmt.close();
con.close();
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
} //end class CreateCoffees
---There are two similar threads:
http://swforum.sun.com/jive/thread.jspa?threadID=61327&tstart=0
http://swforum.sun.com/jive/thread.jspa?threadID=51057&messageID=188210
To summarize - the DataDirectDriver that is shipped with the IDE seems to be locked to be used inside the IDE only because of some licensing issues etc..
That's weird, I agree. I will raise a question on reasons for such a behavior.
The solution would be to use Oracle's own driver, that is distributed at no charge from their web site - http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
HTH,
Kirill -
IPlanet Web Server gives classnot found "oracle.jdbc.driver.OracleDriver "
I have installed iplaet web server 6 eval. copy on red hat linux 6.2 , oracle 8i 8.1.6 having default classpath with
/usr/local/jdk1.2.2:/usr/local/jsdk.jar:/usr/local/jdk1.2.2/oracle.jar
when we run a servlet it gives classnot found "oracle.jdbc.driver.OracleDriver "
Any one can give me where to place oracle.jar or how to overcome from this error
the code is
import java.util.*;
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import oracle.jdbc.driver.*;
* This is a simple example of an HTTP Servlet. It responds to the GET
* and HEAD methods of the HTTP protocol.
public class Hello2 extends HttpServlet
public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletExc
eption, IOException
PrintWriter out;
String title = "12Example iPlanet JServ Servlet";
response.setContentType("text/html");
out = response.getWriter();
Statement stmt=null;
ResultSet rs=null;
Connection con;
out.println("<H2> iPlanet is working!!</H2>");
try
// String url = "jdbc:oracle:thin:@80.0.0.2:1521:sahara";
// Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection("jdbc:oracle:thin:@(description=(address=(host=80
.0.0.2)(protocol=tcp)(port=1521))(connect_data=(sid=star)))","zigma","zigma");
// con = DriverManager.getConnection(url, "rahul", "rahul");
String sQuery2="select zrsbname from zrsbmast where zrsbcode=9999";
stmt=con.createStatement();
rs = stmt.executeQuery(sQuery2);
rs.next();
/*String sQuery="{call shift20()}";
cstmt=con.prepareCall(sQuery);
cstmt.executeQuery(); */
out.println("<HTML><HEAD><TITLE>");
out.println(title);
out.println("</TITLE></HEAD><BODY bgcolor=\"#FFFFFF\">");
out.println("<H1>"+iCount+"</H1>");
out.println("<H1>" + title + "</H1>");
out.println("<H2> Congratulations, iPlanet is working!1<br>");
out.println("</BODY></HTML>");
out.close();
catch(SQLException e1)
out.println("<p> Error in ");
out.println("<p> Errmsg="+ e1.getMessage());
catch(Exception e)
out.println("<p> Error in ");
out.println("<p> Errmsg="+ e.getMessage());you must be having an administrative console for iplanet
there the classpath can be set to the required location
Open the Administrative console for it.. -
Does oracle jdbc driver 9.0.1 work with sdk 1.4?
Hi All Experts...
Does oracle jdbc driver 9.0.1 work with sdk 1.4.1? Ever since i have moved to 1.4 i am having problems. I keep getting the No Suitable Driver error or NoClassDefFoundError. I have everything in the classpath and i have also tried command line but to no avail. The JVM just refuses to pick up the classes12.zip file from the classpath.
The oracle site mentions that the 9.0.1 driver is for jdk 1.2 & 1.3 but it does NOT mention that it is NOT for 1.4.1. The site very explicitly mentions that the 9.2 driver is for 1.4.1. SO i am a little confused.This question may be stupid, but nevertheless,If i have to upgrade my driver from 9.0.1 to 9.2 then does that mean that i have to upgrade my DB as well?
Experts..please help.. THanksThanks a lot, as usual, MOD.
Now only if i can get my JVM to pick up the classes12.zip file from the classpath. I dont know if you read my previous posting today. -
Which Oracle JDBC Driver to use with WSAD 5.1.2?
Hi,
I will appreciate if someone could help me with:
1) Whether I should select "Oracle JDBC Driver" or "Oracle JDBC Driver (XA)" as the JDBC Provider Type. The rest in the list (Thin & oci8 ) are deprecated.
2) When I go to create a datasource, for either of the above JDBC provider type, I get the options:
- User defined JDBC provider
- Oracle JDBC provider
- Oracle JDBC Thin Driver
- Oracle JDBC oci8 Driver
Why do I have the Thin and Oci8 option here, when those were shown as deprecated under JDBC Provider Type?
Please help to clear up this confusion.
-NimmiThis is what I did for my DS settings
1. select Oracle JDBC Driver
2. set Classes12.jar in Websphre classpath - (Oracle thin driver)
3. create DS with option User defined JDBC provider
means I have added Thin driver provided by Oracle , instead of deprecated Thin driver from IBM. -
Hi,
I am writing a J2EE application which (in theory, at least)
connects to an Oracle 9i database.
I have written a simple Java test app utilising only the
java.sql package classes (e.g. Connection, ResultSet) to directly
connect to the database. As long as the classes12.zip is in the
CLASSPATH it works fine.
Now I have written an Enterprise application (SessionBean,
Remote and Home interface and Client) which I am attempting to
deploy via deploytool.
If I include just the client jar and EJB jar in the application
it deploys okay but when I run the application (using runclient)
it produces the following error:
java.lang.NoClassDefFoundError: oracle/jdbc/OracleDriver
(It is nested within other error output but that is the core
issue).
However if I try to include the JAR libraries into the app
(classes12.jar and nls_charset.jar from $ORACLE_HOME/jdbc/lib),
then I get the following output from deploytool when I hit the
"deploy" (or "redeploy") button:
Deployment error: invalid entry compressed size
(expected 14411 but got 14580 bytes)
Can someone please tell me what is going on???
How can I deploy the J2EE application including the Oracle
JDBC Driver???
My only other option at the moment is to place all the function-
-ality in the client and not use the J2EE framework.
Any help is greatly appreciated.
Regards,
Ben New
Leftclick Software Development
[email protected]OK Ben,
I admit I'm a bit confused. Let me see if I understand where you're
coming from.
You have written a J2EE application that includes a session bean,
correct? If so, your session bean needs to be deployed to an EJB
container. What container are you using? The Oracle 9i database
has an embedded EJB container which (theoretically) you can use.
However, as far as I know, Oracle recommends you use OC4J as the
EJB container. So again I ask, what EJB container are you using?
If, as you say, you are new to EJB, then I think you should
immediately start working wiht OC4J as your EJB container.
Did you look at the tutorial link I gave in my previous post? It
explains -- step by step -- how to create, deploy and run a J2EE
application using OC4J as the EJB container. It also has links to
introductory material for people without little knowledge of J2EE
and EJB.
I have 9iAS Enterprise Edition and 8.1.7.1.0 database server (and
OC4J) installed on my SUN machine. I cannot find any of the
utilities you mention -- "j2eeadmin","runclient" or "deploytool".
What Oracle software have you installed? What are the versions?
What platform are you using?
A J2EE application (according to the specification from SUN)
consists of modules. A module can either be a client module or an
EJB module. A client module can either be a java application client
or a web-based client (servlet or JSP). A J2EE application usually
contains one client module and one EJB module. A J2EE application
needs to be deployed to a J2EE container.
Hopefully the J2EE picture is becoming clearer. I think you need
to read some introductory material regarding J2EE if you intend
to become proficient at it.
I feel that you are under the impression that a J2EE application
is a glorified JDBC application. It isn't (as far as I'm aware).
Good Luck,
Avi. -
CLassCastException with oracle.jdbc.driver.OracleCallableStatement
Hello,
I get a ClassCastException when I try to execute a Stored Procedure with WL6.1
and the JDriver.
I have a servlet who intanciate a Bean and call to his execute() method in this
way:
Context ctx = null;
Hashtable ht = new Hashtable();
Connection conn = null;
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
try {
ctx = new InitialContext(ht);
javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(connPool);
conn = ds.getConnection();
conn.setAutoCommit(true);
SvcEmpEstObt empEstObt = new SvcEmpEstObt();
empEstObt.setMaxRows(100);
empEstObt.setConnection(conn);
//Get parameters from Http Get and set the JB
empEstObt.setEmpRut(request.getParameter("rut"));
empEstObt.setEmpTimeStamp(request.getParameter("timestamp"));
//Execute Service
empEstObt.execute();
/* ********* the execute() method of the jb is listed here */
public int execute() throws ClassNotFoundException, SQLException{
intreturnedRows = 0;
try {if (connection == null){
try {Class.forName(driver);
} catch (ClassNotFoundException e) {
System.err.println("ClassNotFoundException: " + e);
throw e;
connection = DriverManager.getConnection(url, user, password);
row = -1;
srv_message = String.valueOf(maxRows);
String sp = "{call SvcEmpEstObt_Pkg.SvcEmpEstObt(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}";
oracle.jdbc.driver.OracleCallableStatement procout = (oracle.jdbc.driver.OracleCallableStatement)
connection.prepareCall(sp); // The exception is here
procout.registerOutParameter(1, Types.VARCHAR);
procout.setString(1, srv_message);
procout.setString(2, empRut);
procout.setString(3, empTimeStamp);
procout.registerOutParameter(4, Types.VARCHAR);
procout.registerOutParameter(5, Types.VARCHAR);
procout.registerOutParameter(6, Types.INTEGER);
int elemSqlType = OracleTypes.INTEGER;
int elemMaxLen = 0;
procout.registerIndexTableOutParameter(7, maxRows, elemSqlType, elemMaxLen);
elemSqlType = OracleTypes.VARCHAR;
elemMaxLen = 30;
// register the OUT parameter
procout.registerIndexTableOutParameter(8, maxRows, elemSqlType, elemMaxLen);
elemSqlType = OracleTypes.VARCHAR;
elemMaxLen = 21;
// register the OUT parameter
procout.registerIndexTableOutParameter(9, maxRows, elemSqlType, elemMaxLen);
elemSqlType = OracleTypes.INTEGER;
elemMaxLen = 0;
// register the OUT parameter
procout.registerIndexTableOutParameter(10, maxRows, elemSqlType, elemMaxLen);
// execute the call
procout.execute();
sqlWarning = procout.getWarnings();
srv_message = procout.getString(1);
returnStatus = new Integer(srv_message.substring(0,1)).intValue();
dagMessage = new DagMessage();
dagMessage.oracleMessage(srv_message);
// access the value using JDBC default mapping
empEstTitulo = procout.getString(4);
empEstUniv = procout.getString(5);
empEstNivel = procout.getInt(6);
curCodigo = (BigDecimal[]) procout.getPlsqlIndexTable(7);
curNombre = (String[]) procout.getPlsqlIndexTable(8);
curFecha = (String[]) procout.getPlsqlIndexTable(9);
curDuracion = (BigDecimal[]) procout.getPlsqlIndexTable(10);
// close the statement
procout.close();
if (curCodigo == null) {
return 0;
} else {
return curCodigo.length;
} catch (SQLException e) {
SQLException ex = e;
System.err.println("\n--- SQLException caught ---\n");
while (ex != null) {
System.err.println("Message: " + ex.getMessage ());
System.err.println("SQLState: " + ex.getSQLState ());
System.err.println("ErrorCode: " + ex.getErrorCode ());
ex = ex.getNextException();
System.out.println("");
throw e;
Does Someone has an idea why it happens ?Hans,
Could you give us the whole text of exception?
Regards,
Slava Imeshev
"Hans" <[email protected]> wrote in message
news:[email protected]...
>
It Works! Thanx a lot ....
I was working with a previous version of my App ... I fixed the problemand now
i can Cast to weblogic.jdbc.vendor.oracle.OracleCallableStatement,
But ...
I get the following Exception:
SQL Exception:
registerIndexTableOutParameter is not supported by the
underlying JDBC driver weblogic.jdbc.pool.Connection
What I need to do ?
/* this is what i`m trying to make */
weblogic.jdbc.vendor.oracle.OracleCallableStatement procout =(weblogic.jdbc.vendor.oracle.OracleCallableStatement)
connection.prepareCall(sp);
procout.registerOutParameter(1, Types.VARCHAR);
procout.setString(1, srv_message);
procout.setString(2, empRut);
procout.setString(3, empTimeStamp);
procout.registerOutParameter(4, Types.VARCHAR);
procout.registerOutParameter(5, Types.VARCHAR);
procout.registerOutParameter(6, Types.INTEGER);
int elemSqlType = OracleTypes.INTEGER;
int elemMaxLen = 0;
procout.registerIndexTableOutParameter(7, maxRows, elemSqlType,elemMaxLen);
>
elemSqlType = OracleTypes.VARCHAR;
elemMaxLen = 30;
// register the OUT parameter
procout.registerIndexTableOutParameter(8, maxRows, elemSqlType,elemMaxLen);
>
elemSqlType = OracleTypes.VARCHAR;
elemMaxLen = 21;
// register the OUT parameter
procout.registerIndexTableOutParameter(9, maxRows, elemSqlType,elemMaxLen);
>
elemSqlType = OracleTypes.INTEGER;
elemMaxLen = 0;
// register the OUT parameter
procout.registerIndexTableOutParameter(10, maxRows, elemSqlType,elemMaxLen);
>
>
"Hans" <[email protected]> wrote:
Thanx Slava,
But I have the same problem again...
I replace oracle.jdbc.driver.OracleCallableStatement with
weblogic.jdbc.vendor.oracle.OracleCallableStatement
and I get the same ClassClastException in
weblogic.jdbc.vendor.oracle.OracleCallableStatement procout =
(weblogic.jdbc.vendor.oracle.OracleCallableStatement)
connection.prepareCall(sp);
Any ideas ??
"Slava Imeshev" <[email protected]> wrote:
Hi Hans,
You can not cast returned object to
oracle.jdbc.driver.OracleCallableStatement
when accessing oracle db via connection pool.
It can be casted to weblogic.jdbc.vendor.oracle.OracleCallableStatement.
Here is a list of methods supported by this interface:
void clearParameters() throws java.sql.SQLException;
void registerIndexTableOutParameter(int i, int j, int k, int l) throws
java.sql.SQLException;
void registerOutParameter(int i, int j, int k, int l) throws
java.sql.SQLException;
java.sql.ResultSet getCursor(int i) throws java.sql.SQLException;
java.io.InputStream getAsciiStream(int i) throws
java.sql.SQLException;
java.io.InputStream getBinaryStream(int i) throwsjava.sql.SQLException;
java.io.InputStream getUnicodeStream(int i) throwsjava.sql.SQLException;
>>>
Regards,
Slava Imeshev
"Hans" <[email protected]> wrote in message
news:[email protected]...
Hello,
I get a ClassCastException when I try to execute a Stored Procedurewith
WL6.1
and the JDriver.
I have a servlet who intanciate a Bean and call to his execute()
method
in
this
way:
Context ctx = null;
Hashtable ht = new Hashtable();
Connection conn = null;
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFact
or
y");
try {
ctx = new InitialContext(ht);
javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup(connPool);
conn = ds.getConnection();
conn.setAutoCommit(true);
SvcEmpEstObt empEstObt = new SvcEmpEstObt();
empEstObt.setMaxRows(100);
empEstObt.setConnection(conn);
file://Get parameters from Http Get and set the JB
empEstObt.setEmpRut(request.getParameter("rut"));
empEstObt.setEmpTimeStamp(request.getParameter("timestamp"));
file://Execute Service
empEstObt.execute();
/* ********* the execute() method of the jb is listed here */
public int execute() throws ClassNotFoundException, SQLException{
intreturnedRows = 0;
try {if (connection == null){
try {Class.forName(driver);
} catch (ClassNotFoundException e) {
System.err.println("ClassNotFoundException: " + e);
throw e;
connection = DriverManager.getConnection(url, user, password);
row = -1;
srv_message = String.valueOf(maxRows);
String sp = "{call SvcEmpEstObt_Pkg.SvcEmpEstObt(?, ?, ?, ?, ?, ?,?, ?,
oracle.jdbc.driver.OracleCallableStatement procout =(oracle.jdbc.driver.OracleCallableStatement)
connection.prepareCall(sp); // The exception is here
procout.registerOutParameter(1, Types.VARCHAR);
procout.setString(1, srv_message);
procout.setString(2, empRut);
procout.setString(3, empTimeStamp);
procout.registerOutParameter(4, Types.VARCHAR);
procout.registerOutParameter(5, Types.VARCHAR);
procout.registerOutParameter(6, Types.INTEGER);
int elemSqlType = OracleTypes.INTEGER;
int elemMaxLen = 0;
procout.registerIndexTableOutParameter(7, maxRows, elemSqlType,elemMaxLen);
elemSqlType = OracleTypes.VARCHAR;
elemMaxLen = 30;
// register the OUT parameter
procout.registerIndexTableOutParameter(8, maxRows, elemSqlType,elemMaxLen);
elemSqlType = OracleTypes.VARCHAR;
elemMaxLen = 21;
// register the OUT parameter
procout.registerIndexTableOutParameter(9, maxRows, elemSqlType,elemMaxLen);
elemSqlType = OracleTypes.INTEGER;
elemMaxLen = 0;
// register the OUT parameter
procout.registerIndexTableOutParameter(10, maxRows, elemSqlType,elemMaxLen);
// execute the call
procout.execute();
sqlWarning = procout.getWarnings();
srv_message = procout.getString(1);
returnStatus = new Integer(srv_message.substring(0,1)).intValue();
dagMessage = new DagMessage();
dagMessage.oracleMessage(srv_message);
// access the value using JDBC default mapping
empEstTitulo = procout.getString(4);
empEstUniv = procout.getString(5);
empEstNivel = procout.getInt(6);
curCodigo = (BigDecimal[]) procout.getPlsqlIndexTable(7);
curNombre = (String[]) procout.getPlsqlIndexTable(8);
curFecha = (String[]) procout.getPlsqlIndexTable(9);
curDuracion = (BigDecimal[]) procout.getPlsqlIndexTable(10);
// close the statement
procout.close();
if (curCodigo == null) {
return 0;
} else {
return curCodigo.length;
} catch (SQLException e) {
SQLException ex = e;
System.err.println("\n--- SQLException caught ---\n");
while (ex != null) {
System.err.println("Message: " + ex.getMessage ());
System.err.println("SQLState: " + ex.getSQLState ());
System.err.println("ErrorCode: " + ex.getErrorCode ());
ex = ex.getNextException();
System.out.println("");
throw e;
Does Someone has an idea why it happens ?
Maybe you are looking for
-
Journal import fails when called from PLSQL
Hi, When journal import is called from plsql code it is failing with error in 'gllacc() Function returning without value and no data found'. Same transaction is run succesfully from front end. I checked both gl_interface and gl_interface_control tabl
-
Hello people, I want to use console for JPQL I found https://jpaquerytool.dev.java.net/how-to.html and install it, but then I added my-app.jar and persistence unit name, after run I have one warning - "could not load persistance unit check your datab
-
Business Logic Editor with Complex Transasctions
I'm starting to have some serious problems using the Business Logic Editor with reasonably large (but by no means huge) transactions. These transactions also have nested transaction calls down a few layers. The main symptoms are: 1) When opening the
-
How to compile and install driver?
Hey there, I've got the source for a driver, but how do I compile and install it? Thanks.
-
Hi all, I wonder if you guys know how to implement Oracle 10g Spatial (geocoder, spatial data for the whole country, and possiably map viewer)? I know there are some documents out there, but none of them are about implementation. do you know any step