JDBC x Oracle on J2EE
Hi,
I try to add a JDBC driver on a J2EE but I had no success. I save Oracle JDBC classes in lib/system and change J2EE_CLASSPATH on bin/userconfig batch file to j2sdkee1.3.1\lib\system but it does not work. I restarted J2EE but it returns:
"java.rmi.RemoteException: nested exception is: javax.ejb.EJBException: Unable to connect to database. No suitable driver; nested exception is:"
Thanks,
Celso
hi,
A guess... seems you need to edit the resource.properties file and do the necessary things to register the database and datasource..
see these pages for more details..
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Tools2.html#63229
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Admintool5.html#74008
hope that helps,
-Jer
Similar Messages
-
Hi All,
I am getting below build error. I am migrating weblogic 10. Which jar file contains this interface: weblogic.jdbc.vendor.oracle.OracleThinClob?
Error:
package weblogic.jdbc.vendor.oracle does not exist [javac] if (theClob instanceof weblogic.jdbc.vendor.oracle.OracleThinClob)
I already got weblogic.jar file from weblogic 10.
Thanks,
SrinivasSrinivas U wrote:
Hi All,
I am getting below build error. I am migrating weblogic 10. Which jar file contains this interface: weblogic.jdbc.vendor.oracle.OracleThinClob?
Error:
package weblogic.jdbc.vendor.oracle does not exist [javac] if (theClob instanceof weblogic.jdbc.vendor.oracle.OracleThinClob)
I already got weblogic.jar file from weblogic 10.
Thanks,
SrinivasIt's in the datasource module/jar: modules/com.bea.core.datasource_1.0.0.0.jar -
[Oracle JDBC Driver][Oracle]ORA-31011: XML parsing failed
Hi,
I have got the following error when i tired to upload an XML file in my application. My application will insert the XML file in to Oracle 10g data base table. (Our DB server is Oracle 10g).
The error is as follows:-
[BEA][Oracle JDBC Driver][Oracle]ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00004: internal error "MultiChar overflow"
Error at line 20795
ORA-06512: at "SYS.XMLTYPE", line 254
ORA-06512: at line 1
The XML file contains more than 90,000 lines in it. Please help.
Thanks!
Siva K.Is this a specific problem with 10G release? We are using 10.2.0.4.0.
Using CLOB, We think that this may hit the performance of the application as we are using large XML files. -
Hi guys, i hope somebody would help me. I've a JDBC Adapter who's trying to write in a DB Oracle 10g, but i got this error.
Receiver Adapter v2108 for Party '', Service <service>:
Configured at 11:54:35 2005-11-15
Processing Error: Accessing database connection 'jdbc:oracle:thin:@<host>:<port>:<db>' failed: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
Addtional information: JDBC driver 'oracle.jdbc.driver.OracleDriver' loaded successfully, additional driver information:
Available JDBC drivers:
oracle.jdbc.driver.OracleDriver, 1.0 JDBC compliant
com.microsoft.jdbc.sqlserver.SQLServerDriver, 2.2 JDBC compliant
It could be because of the version of my oracle driver, but i'm not sure. And if it's a driver version problem, how could i fix it to be able to support Oracle 10g.
Well, thanks in advance.Hi,
this message indicates that it seems veverythin ok on the server side, but your driver cannot reach the DB. Did you configure this with openSQL? did you check the SQL Trace?
Regards,
Benny -
Class Not Found: JDBC driver oracle.jdbc.driver.OracleDriver
Does anyone can help?
When I install the OpenBravo, I get the error shown below:
Class Not Found: JDBC driver oracle.jdbc.driver.OracleDriver could not be loaded.
I am using the Oracle XE, jdk1.5.0_06, Apache Tomcat 5.5.17.include the jar file classes111.jar in your classpath, it will work
The location would be like
C:\Applns\oracle9204\jdbc\lib\classes111.jar;
set the classpath with this jar in command prompt
set CLASSPATH=%CLASSPATH%;C:\Applns\oracle9204\jdbc\lib\classes111.jar; -
Performanceproblem with WL6.1 JDBC and Oracle
Hi!
I have a big performance-problem using wl6.1, jdbc and oracle.
My Server is sending a Vector with NodeBeans via JDBC to a OracleDB. The answer
comes immediately with the timeout.
Why is the EJB waiting for the timeout?
Is it a problem of configuration?
Thanks
ThomasHi Sree,
here I send You the class with the main problem. The call queryDataSet.refresh();
is the timeconsuming part.
We are using WL6.1sp2, Oracle 8.1.7 with classes12. In our environment we can
not use connectionpools.
It comes back with a timeout AND the data. Calling it again immediately it takes
2/3 of the time the timeout is set.
Do You have a fine solution?
Thanks
Thomas
package ppif.db;
import java.rmi.*;
import ppif.bo.*;
import java.util.*;
import com.borland.dx.dataset.*;
import com.borland.dx.sql.dataset.*;
import java.math.*;
public class connector {
private ppif.mapping.NodeDescriptions nodeDescriptions;
public connector(ppif.mapping.NodeDescriptions nodeDescriptions) {
this.nodeDescriptions = nodeDescriptions;
public connector() {
this.nodeDescriptions = nodeDescriptions;
public Vector fetchNodes(ppif.bo.Node filterNode) throws RemoteException {
String childClassName = null;
Vector nodeVector = new Vector();
Node node = null;
if (nodeDescriptions == null) throw new RemoteException("nodeDescriptions ==
null");
// childClassName zu gegebenen filterNode ermitteln
if (filterNode.getClassName().equals("DefaultRoot")) childClassName = "ST";
if (filterNode.getClassName().equals("PrismaProjectsRoot")) childClassName =
"PrismaProjects";
if (childClassName == null) throw new RemoteException("Zum übergebenen filterNode
wurde kein chlidClassName gefunden.");
if (nodeDescriptions.getNodeDescription(childClassName) == null) throw new RemoteException("Für
die ChildClass "+childClassName+" ist kein Mapping definiert.");
// Vector mit Child-Knoten erzeugen durch DB-Zugriff
ppif.mapping.NodeDescription nodeDescription = nodeDescriptions.getNodeDescription(childClassName);
Database database = new Database();
ParameterRow parameterRow = null;
Column column = null;
QueryDataSet queryDataSet = new QueryDataSet();
// DB-Connect generieren
database.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor(nodeDescription.dbUrl,
nodeDescription.dbUser, nodeDescription.dbPassword, false, "oracle.jdbc.driver.OracleDriver"));
int queryCount = 0;
// Schleife über alle queries der childKlasse, gemäss Mapping
for (Iterator it = nodeDescription.mappingQueries.iterator(); it.hasNext();
ppif.mapping.MappingQuery mappingQuery = (ppif.mapping.MappingQuery)it.next();
String queryString = mappingQuery.getQueryString();
parameterRow = mappingQuery.getParameterRow();
// ParameterRow mit Input-Werten füllen
for (int i=0; i<parameterRow.getColumnCount(); i++) {
String columnName = parameterRow.getColumn(i).getColumnName();
String filterAttributeName = columnName;
Object filterAttributeValue = filterNode.getAttribute(filterAttributeName).getVal1();
switch (parameterRow.getColumn(i).getDataType()) {
case com.borland.dx.dataset.Variant.BIGDECIMAL:
BigDecimal val = (BigDecimal)filterAttributeValue;
parameterRow.setBigDecimal(i, val);
break;
case com.borland.dx.dataset.Variant.STRING:
parameterRow.setString(i, (String)filterAttributeValue);
break;
default:
throw new RemoteException("Unbekannter Datentyp");
// Query generieren
queryDataSet.setQuery(new com.borland.dx.sql.dataset.QueryDescriptor(database,
queryString, parameterRow, false, Load.ALL));
// DB-Verbindung öffnen
queryDataSet.open();
// Rolle setzen
if (nodeDescription.dbRole != null) {
java.sql.Statement setRole;
String roleName = nodeDescription.dbRole;
String rolePwd = nodeDescription.dbRolePassword;
try {
java.sql.Connection jdbcConnection = database.getJdbcConnection();
setRole = jdbcConnection.createStatement();
setRole.execute("SET ROLE " + roleName + " IDENTIFIED BY " + rolePwd);
} catch (java.sql.SQLException exception) {
throw new RemoteException(exception.getMessage());
} catch (Exception exception) {
throw new RemoteException(exception.getMessage());
// Query ausführen
queryDataSet.refresh();
// Datensätze in Node-Objekte umwandeln
int columnCount = queryDataSet.getColumnCount();
String columnArray[];
columnArray = queryDataSet.getColumnNames(columnCount);
for(queryDataSet.first(); queryDataSet.inBounds(); queryDataSet.next()) {
Node rNode = nodeDescriptions.createNodeInstance(childClassName);
// Abfrageergebnissen in eine Attributliste übertragen
for (int i=0; i<columnCount; i++) {
nodeVector.add(rNode);
queryCount++;
return nodeVector;
public ppif.mapping.NodeDescriptions getNodeDescriptions() {
return nodeDescriptions;
public void setNodeDescriptions(ppif.mapping.NodeDescriptions nodeDescriptions)
this.nodeDescriptions = nodeDescriptions;
"Sree Bodapati" <[email protected]> wrote:
hi Thomas,
please post more detail on what your code is doing. if possible a code
snippet/error messages/thread dump
sree
"Thomas Eberhard" <[email protected]> wrote in message
news:[email protected]...
Hi!
I have a big performance-problem using wl6.1, jdbc and oracle.
My Server is sending a Vector with NodeBeans via JDBC to a OracleDB.
The
answer
comes immediately with the timeout.
Why is the EJB waiting for the timeout?
Is it a problem of configuration?
Thanks
Thomas -
Where can i find the Oracle JDBC for Oracle RDBMS 8.1.7 ? Thanks.
Where can i find the Oracle JDBC for Oracle RDBMS 8.1.7 ? Thanks.
http://otn.oracle.com/software/tech/java/sqlj_jdbc/content.html
-
Oracle.jdbc vs oracle.jdbc2
Hello World,
Whar is the differens between
oracle.jdbc
and
oracle.jdbc2
Where ca I read more about it?
Best regards
Anders Gunnare
FrontecThe weblogic driver is a type 2 (native) driver based upon the native OCI
Oracle client libraries. The Oracle thin driver is a type 4 (pure java)
driver. Type 2 drivers are typically faster but if you want to make a
performance based decision you should also include the type 2 driver(s)
available from Oracle in the comparison.
-Charlie
Mahesh wrote:
Hi,
We are curently using Oracle thin drivers for our
production servers. The Weblogic version is 5.1 SP9 and Oracle version is
8.1.6. Does anybody have any information about performance comparisons
between Weblogic's thin drivers and Oracle's ?
Thanx in advance
Mahesh -
b font color ='red' Java JDBC and Oracle DB URGENT HELP PLEASE /font /b
Hello, I am a newbie. I'm very interested in Java in relation to JDBC, Oracle and SAP.I am trying to connect to an Oracle DB and I have problems to display the output on the consule in my application. What am I doing wrong here . Please help me. This is my code: Please Explain
import java.sql.*;
import java.sql.DriverManager;
import java.sql.Connection;
public class SqlConnection {
public static void main(String[] args) {
Class.forName("oracle.jdbc.driver.OracleDriver"); //Loading the Oracle Driver.
Connection con = DriverManager.getConnection
("jdbc:orcle:thin:@34.218.5.3:1521:ruka","data","data"); //making the connection.
Statement stmt = con.createStatement ();// Sending a query to the database
ResultSet rs = stmt.executeQuery("SELECT man,jean,test,kok FROM sa_kostl");
while (rs.next()) {
String man = rs.getString("1");
String jean = rs.getString("2");
String test = rs.getString("3");
String kok = rs.getString("4");
System.out.println( man, jean, test,kok );//here where my the
//compiler gives me errors
stmt.close();
con.close();
}<b><font color ='red'>Java JDBC and Oracle DB URGENT HELP PLEASE</font></b>Too bad your attempt at getting your subject to have greater attention failed :p
-
I need help with deployment of ColdFusion as a J2EE app using an EAR file generated from the coldfusion-702-lin.bin installer downloaded from Adobe/Macromedia.
I created an OC4J instance and tried to deploy the EAR file with the Enterprise Manager Console. The result was this error:
500 Internal Server Error
Servlet error: java.lang.ClassNotFoundException: ias.oc4j._deploywiz._selectAppDest
This is on Linux (RHEL 3) using the OAS middle tier.
Any suggestions would be appreciated!SOLUTION FOUND:
* deploy EAR file ***using dcmctl*** (this worked even though using Enterprise Manager failed)
+ ensure that OAS and the OC4J J2EE container are running
+ $ <midtier java_home>/dcm/bin/dcmctl deployapplication -f <earfile> -a <new app name> -co <component name>
+ add "grant { permission java.security.AllPermissions; };" to oracle/belljava_mid/j2ee/cfmx7/config/java2.policy
+ add lib paths per Oracle Technical Note page: http://www.oracle.com/technology/pub/notes/technote_coldfusion.html -
JDBC external oracle invalid URL
Ok after deploying oracle jdbc now I am getting this error:
Error during database connection to the database URL 'jdbc:oracle:thin@torigai:1527:DSORACLE' using the JDBC driver 'oracle.jdbc.driver.OracleDriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Cannot establish connection to URL 'jdbc:oracle:thin@torigai:1527:DSORACLE': SQLException: Invalid Oracle URL specified'
Could this be becauase the external oracle DB is a 9.2 instance and the source is 10g? Should I deploy classes14.jar along with ojdbc.jar.....?
Thanks
MikieHi,
The reason is that the URL is incorrect. You have missed a ":" after "thin".
This is what it should be,
<b>jdbc:oracle:thin<i>:</i>@torigai:1527:DSORACLE</b>
><i>Should I deploy classes14.jar along with ojdbc.jar.....?</i>
Not needed at all. Infact you should use either ojdbc.jar or classes14.jar and not both.
From the SAP note : 831162
<i>
have deployed the Oracle classes12.zip / classes12.jar JDBC driver as per the instructions in the XI Configuration Guide.
Unfortunately, I frequently notice hanging database connections. A thread dump taken according to the instructions in note 710154 shows one or more blocking JDBC Sender/Reciver threads and optionally that the JVM has detected a deadlock.
A: The Oracle classes12.zip / classes12.jar driver is compatible with JDK 1.2 and 1.3 only, but not with JDK 1.4. Upgrade to a current version of the driver (ojdbc14.jar). For details, refer to note 941317.
Make sure that you remove classes12.zip / classes12.jar from aii_af_jmsproviderlib.sda prior to adding the new driver as per the instructions in the answer to question #1 above as you will get a class name collision otherwise (all JARs from aii_af_jmsproviderlib.sda are loaded into the same class loader and the driver class name of both driver versions is the same).
Before deploying the updated driver, ensure that the new version is still compatible with your Oracle database server release. For details, refer to the release notes provided by Oracle.</i>
Regards,
Bhavesh -
Hi,
I am facing following issue in my one environment. but in other environment same class path is working fine. I have compared all jar and classpath for both weblogic server.
I am using weblogic 11g.
27 Mar 2013 15:21:09,507 ERROR XXXServlet:293 - oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray
java.lang.ClassCastException: oracle.sql.ARRAY incompatible with weblogic.jdbc.vendor.oracle.OracleArray
at com.emc.nems.wsd.ui.beans.reports.mpapi.FacilityBeanType.nullSafeGet(FacilityBeanType.java:126)
at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:128)
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2114)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
at org.hibernate.loader.Loader.getRow(Loader.java:1230)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
at org.hibernate.loader.Loader.doQuery(Loader.java:724)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
at org.hibernate.loader.Loader.doList(Loader.java:2232)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
at org.hibernate.loader.Loader.list(Loader.java:2124)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1723)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
at com.emc.nems.oms.dao.hibernate.util.OMSHibBaseDAO.executeNamedQueryWithoutTransaction(Unknown Source)
at com.emc.nems.wsd.dao.hibernate.reports.mpapi.MpapiReportHibDAO.findMCR020(Unknown Source)
at com.emc.nems.wsd.ui.handler.reports.ReportsHandler.getMPAPIData(Unknown Source)
at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.executeReport(XXXServlet.java:1009)
at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.generateAuditFile(XXXServlet.java:318)
at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.execute(XXXServlet.java:273)
at com.emc.nems.wsd.ui.servlets.reports.mpapi.MpapiServlet.doGet(XXXServlet.java:207)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3731)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3695)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2285)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2184)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1459)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Regards,
AbhishekCreating my Oracle connection works fine ... code as follows:
<i>Context ctxt = getInitialContext();
DataSource dataSource = (DataSource) ctxt.lookup(poolName);
Connection conn = dataSource.getConnection();
OracleConnection oracleConn = (OracleConnection)((WLConnection)conn).getVendorConnection();</i>
I also have reviewed documentation:
http://e-docs.bea.com/wls/docs81/jdbc/thirdparty.html. In section 'Using OracleStruct Extension Methods' it highlights that
<i>java.sql.Struct struct =(weblogic.jdbc.vendor.oracle.OracleStruct)(rs.getObject(2));</i>
None of the documentation actually mentions <b>oracle.sql.STRUCT</b>. For Weblogic to truely provide support for Oracle it needs an easy way of converting to this data type. At present I cannot interact with Oracle APIs until I can create an oracle.sql.STRUCT. -
Where did weblogic.jdbc.vendor.oracle.OracleThinBlob go?
I just upgraded from 8.1sp4 to 10.1 and the problem I am facing is that the import
import weblogic.jdbc.vendor.oracle.OracleThinBlob;
is no longer valid. I cannot find it even to import. What am I missing??:|
-JoeHi
You will find the 'weblogic.jdbc.vendor.oracle.OracleThinBlob' located in the 'com.bea.core.datasource_1.0.0.0.jar'. You will find this jar in the modules directory, in the top level of your WebLogic 10 installation
e.g. for me, it is located in:
C:\wls10\modules\com.bea.core.datasource_1.0.0.0.jar
Vimala- -
Error Connecting to Oracle from J2EE SDK1.4
I am getting the following error when trying to Ping Oracle from a J2EE 1.4 SDK:
Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Error getting connection from the EIS
I have the following connection information
<jdbc-connection-pool connection-validation-method="auto-commit" datasource-classname="oracle.jdbc.pool.OracleDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" max-pool-size="32" max-wait-time-in-millis="60000" name="OraclePool" pool-resize-quantity="2" steady-pool-size="8" transaction-isolation-level="read-uncommitted">
<property name="url" value="jdbc:oracle:thin:@10.1.4.98:1609:thesid"/>
<property name="password" value="password"/>
<property name="user" value="test"/>
</jdbc-connection-pool>
Can anyone give me any pointers?It looks okay to me. The only thing that jumped out at me is that normally Oracle is on 1521, not the current port you have. Otherwise, I'll drop back 15 and punt on this one.
- Saish
"My karma ran over your dogma." - Anon -
Hi,
I'm trying to Bind Oracle JDBC driver to J2EE and I have no sucess. I try -addJDBC and -addJdbcXADataSource and it returns me (on J2EE startup):
Binding DataSource, name = jdbc/Oracle, url = jdbc:oracle:thin:@localhost:1521:poderoso
Binding DataSource, name = jdbc/Oracle, url = jdbc/Oracle__xa
java.lang.ClassNotFoundException: COM.oracle.classes12
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
Thanks,
Celso Henrique.hi Celso,
Steps to add oracle driver + datasource
1. Copy the JDBC driver JAR file (classes12.jar from ORACLE_HOME/jdbc/lib or download from OTN ) to the $J2EE_HOME/lib/system directory.
2. Add JDBC driver
j2eeadmin -addJdbcDriver oracle.jdbc.driver.OracleDriver3. Add the DataSource
j2eeadmin -addJdbcDatasource jdbc/Oracle jdbc:oracle:thin:@localhost:1521:poderoso4. Update the J2EE_CLASSPATH
Add classes12.jar to J2EE_CLASSPATH
by editing the user configuration script. On UNIX systems the user configuration script is in bin/userconfig.sh, and on Windows it is in bin\userconfig.bat.
5.Restart the J2EE server.
for more info, refer to the Config guide in the doc dir in ur j2ee server install.
Note: if u r using JDK 1.4, use ojdbc14.jar instead of classes12.jar.
Regards
Elango.
Maybe you are looking for
-
Trouble with Sentelic Finger Sensing Pad
I read this thread, but found no solution in it (I did not try patching the kernel, however, as I have read that the sentelic fsp driver is already there). I have basic functionality, tap to click, and can manipulate the cursor, but have no scrollin
-
WF-Batch id needs to be changed on runtime with the user email id.
Hi All, I have a requirement where i have to send an email through workflow, but in the from i have to pass the employee responsible email id. I got the email id in a container. Now how can i replace WF-Batch ( i.e. by default) with the user email id
-
Navigate from an answers request to a BI Publisher report
Is this even possible? The BI Publisher report is built off of 4 different answer request data sets.
-
CS4 stopped working in Vista 64 (both 32 bit and 64 bit)
Photoshop CS4, both 32 bit and 64 bit have been working great until after the Adobe update process loaded 11.0.1. When I try to start either the 32 bit or the 64 bit version of CS 4, I get the opening screen and then an error message that says, ..."P
-
Is the camcorder JVC GZ-EX210 compatible with mac and imovie?
Is the camcorder JVC GZ-EX210 compatible with iMovie?