Jdbc oracle connection
ADVERTISEMENT
hi ,
i can connect to oracle database. also can retrieve a row (as many
elements in a row) into an object. however wen i retrieve many rows
into an array of objects i get an error "ResultSet has no more data".
However i can retrive many rows into an array of objects in
pointbase database . same code isnt workin for oracle.
I am using a inner class in the database contol.
i am usin weblogic's 2XA driver to connect to oracle.
please provide some insight.
THANK YOU
I have it working....the IP address was wrong.:)
Is it possible to write a simple connection pool class common to all containers and driver vendors using reflections?
Similar Messages
-
JDBC-ORACLE CONNECTIVITY ISSUE WITYH OCI8 DRIVER using oracle 11g client..
JDBC-ORACLE CONNECTIVITY ISSUE WITYH OCI8 DRIVER using oracle 11g client..
I am getting below error when i m trying to access oracle db using oracle 11g client. It works with earlier oracle client versions. how do i resolve this. is there any issue with version of ojdbc6.jar that i am using??? I cant use thin driver since its an old application for which i dont have source files.
Apr 6, 2013 1:00:59 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:262)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at PettyCash.SysDate.getSysSubSys(SysDate.java:232)
at org.apache.jsp.PettyCash.index_jsp._jspService(org.apache.jsp.PettyCash.index_jsp:186)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Code is as follow for reference
import oracle.jdbc.driver.*;
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
conn = DriverManager.getConnection ("jdbc:oracle:oci8:@" + database,db_user, db_pass);
eNVIRONMENT VARIABLES set are as follows:
classpath
C:\Program Files\apache-tomcat-5.5.12\common\lib\servlet-api.jar;C:\Program Files\apache-tomcat-5.5.12\webapps\ROOT\WEB-INF\lib\classes12.jar;C:\Program Files\apache-tomcat-5.5.12\webapps\ROOT\WEB-INF\lib\ojdbc6.jar;
JAVA_HOME
C:\Program Files\Java\jdk1.5.0_04
PATH
C:\Program Files\Java\jdk1.5.0_04\bin
ORACLE_HOME
D:\Oracle11\product\11.2.0\client_1\BINApr 8, 2013 5:24:06 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.abc.index_jsp._jspService(org.apache.jsp.abc.index_jsp:280)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595) -
Mars has broken existing JDBC Oracle connections
Hi all,
I've upgraded to Eclipse Mars - but loading the current workspace (I told it to upgrade from Luna for compatibility) has broken the JDBC Oracle connection.
The only settings that may have changed are my machine's Java version. Windows 8.1 has caused me no end of bother recently by having multiple Java installations and being fussy interacting with both 64 and 32 bit versions. I got round this with Luna by forcing a path to v7 in eclipse.ini, but v6 is installed "as default" according to the control panel info. However, both 7 and 8 are supposedly installed.
Using the new Eclipse installer, it was happy to function using the newest version of Java, but I don't think the binary app is reading it.
Error fairly standard from Java - when testing connection
"Cannot load JDBC Driver class: oracle.jdbc.OracleDrvier."
Nothing has changed with the native Oracle instant client.
Posted in both Eclipse and BIRT forums as it's BIRT I'm using.
Any thoughts or more info needed?
ThanksFixed already: Mars needed to restore the previously used OJDBC.jar driver which didn't automatically get read for some reason.
-
Hello All genius plz,
I make a user in Oracle and add a table in it then i want to connect it with my java application what can i do Which driver i select Form DSN .And if any one send me sample code so i will be very thankful to u on [email protected]
1 think i clear here that i already try lot of techinique like adding classes12.zip folder in my lib directory and also extracting and then add it. Setting classpath and try lot of DSN driver but nothing is work please help me on that.
Regards
Uzair Baig
(Always belive in logic)Hello All genius plz,Ah! Finally someone understands! :)
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@127..0.1:1521:uzair","system","manager");
Is that correct. and which driver i select form DSN
1)Oracle ODBC driver OR 2)Microsoft ODBC driver for OracleThe connection string you are using will allow you to connect to your Oracle database using the Oracle thin (type 4) driver. The type 4 driver does not require any ODBC DSN. The type 4 driver does not use ODBC. The type 4 driver allows you to connect to your Oracle database from any machine that has the type 4 driver in it's CLASSPATH, there is no need for the Oracle client or any Oracle network setup on the client (TNS).
The connection string looks OK to me, except the IP address which appears to be missing a zero (0).
Make sure 1521 is the port that Oracle is listening for connections. The port number is user defined and is sometimes changed to allow for multiple listeners or for security reasons. -
(ORA-12505) JDBC - Oracle connectivity Error
Hi
Experts
I am SAP developer.
I am trying to connecting remote server through webDynpro ( SAP programming Tool.) through JDBC. I can directly get connected to Oracle server through SQL plus.
My code to establish connection is
conn =DriverManager.getConnection ("jdbc:oracle:thin:@132.132.48.4:1521:orclahd.adaniahd.com","scott", "tiger");
and i am getting exception.
java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor The Connection descriptor used by the client was: 132.132.48.4:1521:orclahd.adaniahd.comyour database is not registered with the listener.
you need to go to the server and check the status of the listener to see if the database service is registered. If not you need to do it manually.
LSNRCTL status -
Strange problem: JDBC: Oracle Connection: Cursor hangs in ResultSet
Hi,
My program connects to an oracle db and queries all records (480'000) from a table with 4 columns (of which one, Z00_DATA, is of type LONG (and on average is about 1000 chars long)).
From my Windows machine, the program runs fine.
From a linux box the same program doesn't: it executes the statement, but when I skim through the returned resultset (even if I only count the number of records in it, it gets stuck on record 80. No exception thrown (I'm catching a general Exception object), it just hangs.
[[ while (rs.next) { counter++; System.out.println(counter);} ]]
When I change my query slightly and select only 3 columns (all except the LONG one), it runs fine again.
This seems very odd to me since I'm not even reading the data inside the resultSet. (I will later, I'm just debugging now).
Here's the code, if anyone can, please help.
Charlie
code:
public void getNoticesData(String tableName, String[][] cols){
try {
// statements
Statement stmt = alephConn.createStatement();
String selectSQL = "select Z00_DOC_NUMBER, Z00_NO_LINES, Z00_DATA_LEN, Z00_DATA from lux01.z00";
// get data from DB
stmt.execute(selectSQL);
ResultSet rs = stmt.getResultSet();
p("SELECT SQL EXECUTED: " + selectSQL);
int resultsCounter=0;
// for all results
while (rs.next()) {
resultsCounter++;
p(resultsCounter + ", ");
} // cursor
// Close resources
stmt.close();
catch (Exception e) {
p("Exception thrown: " + e);
finally {
p("Finally clause");
}Hi,
My program connects to an oracle db and queries all
records (480'000) from a table with 4 columns (of
which one, Z00_DATA, is of type LONG (and on average
is about 1000 chars long)).
And what is the maximum?
And with the query order what is the size of the long field for the 80th row.
From my Windows machine, the program runs fine.
From a linux box the same program doesn't: it
executes the statement, but when I skim through the
returned resultset (even if I only count the number
of records in it, it gets stuck on record 80. No
exception thrown (I'm catching a general Exception
object), it just hangs.Orcacle drivers for some reason have a tendency to have odd problems.
What are the field types?
Do you have the long field at the end of the field list?
Try it with no data in the long field. And then increase it up to the maximum in the database. -
Trying to Install RMS application 13.2.2 and I get past the pre-installation checks and when I get to the Data Source details and enter the data source details with the check box checked to validate the schema/Test Data Source I get the following error:
Error Connecting to database URL jdbc:oracle:oci:@rmsdbtst as user rms13 java.lang.Exception:UnsatisfiedLinkError encountered when using the Oracle driver. Please check that the library path is set up properly or switch to the JDBC thin client oracle/jdbc/driver/T2CConnection.getLibraryVersioNumber()
Checks performed:
RMS Application code location and directory contents:
[oracle@test-rms-app application]$ pwd
/binary_files/STAGING_DIR/rms/application
[oracle@test-rms-app application]$ ls -ltr
total 144
-rw-r--r-- 1 oracle oinstall 272 Dec 7 2010 version.properties
-rw-r--r-- 1 oracle oinstall 405 Jan 16 2011 expected-object-counts.properties
-rw-r--r-- 1 oracle oinstall 892 May 13 2011 ant.install.properties.sample
-rw-r--r-- 1 oracle oinstall 64004 Jun 6 2011 build.xml
drwxr-xr-x 9 oracle oinstall 4096 Jun 16 2011 rms13
drwxr-xr-x 3 oracle oinstall 4096 Jun 16 2011 installer-resources
drwxr-xr-x 3 oracle oinstall 4096 Jun 16 2011 antinstall
drwxr-xr-x 2 oracle oinstall 4096 Jun 16 2011 ant-ext
drwxr-xr-x 5 oracle oinstall 4096 Jun 16 2011 ant
-rw-r--r-- 1 oracle oinstall 11324 Dec 18 09:18 antinstall-config.xml.ORIG
-rwxr-xr-x 1 oracle oinstall 4249 Dec 18 10:01 install.sh
drwxr-xr-x 4 oracle oinstall 4096 Dec 18 10:06 common
-rw-r--r-- 1 oracle oinstall 16244 Dec 19 10:37 antinstall-config.xml
-rw-r--r-- 1 oracle oinstall 689 Dec 19 10:37 ant.install.log
[oracle@test-rms-app application]$
Application installation:
[oracle@test-rms-app application]$ ./install.sh
THIS IS the driver directory
Verified $ORACLE_SID.
Verified SQL*Plus exists.
Verified write permissions.
Verified formsweb.cfg read permissions.
Verified Registry.dat read permissions.
Verified Java version 1.4.2.x or greater. Java version - 1.6.0
Verified Tk2Motif.rgb settings.
Verified frmcmp_batch.sh status.
WARNING: Oracle Enterprise Linux not detected. Some components may not install properly.
Verified $DISPLAY - 172.16.129.82:0.0.
This installer will ask for your "My Oracle Support" credentials.
Preparing installer. This may take a few moments.
Your internet connection type is: NONE
Integrating My Oracle Support into the product installer workflow...
[move] Moving 1 file to /binary_files/STAGING_DIR/rms/application
Installer preparation complete.
MW_HOME=/u01/app/oracle/Middleware/NewMiddleware1034
ORACLE_HOME=/u01/app/oracle/Middleware/NewMiddleware1034/as_1
ORACLE_INSTANCE=/u01/app/oracle/Middleware/NewMiddleware1034/asinst_1
DOMAIN_HOME=/u01/app/oracle/Middleware/NewMiddleware1034/user_projects/domains/rmsClassDomain
WLS_INSTANCE=WLS_FORMS
ORACLE_SID=rmsdbtst
JAVA_HOME=/u01/app/oracle/jrockit-jdk1.6.0_45-R28.2.7-4.1.0
Launching installer...
To make sure I have connectivity from the app server to the database (on a database server) here are the steps followed:
[oracle@test-rms-app application]$ tnsping rmsdbtst
TNS Ping Utility for Linux: Version 11.1.0.7.0 - Production on 19-DEC-2013 10:41:40
Copyright (c) 1997, 2008, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = test-rms-db.vonmaur.vmc)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = rmsdbtst)))
OK (0 msec)
[oracle@test-rms-app application]$
[oracle@test-rms-app application]$ sqlplus rms13@rmsdbtst
SQL*Plus: Release 11.1.0.7.0 - Production on Thu Dec 19 10:46:18 2013
Copyright (c) 1982, 2008, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@test-rms-app application]$
[oracle@test-rms-app application]$ ping test-rms-db
PING test-rms-db.vonmaur.vmc (192.168.1.140) 56(84) bytes of data.
64 bytes from test-rms-db.vonmaur.vmc (192.168.1.140): icmp_seq=1 ttl=64 time=0.599 ms
64 bytes from test-rms-db.vonmaur.vmc (192.168.1.140): icmp_seq=2 ttl=64 time=0.168 ms
64 bytes from test-rms-db.vonmaur.vmc (192.168.1.140): icmp_seq=3 ttl=64 time=0.132 ms
64 bytes from test-rms-db.vonmaur.vmc (192.168.1.140): icmp_seq=4 ttl=64 time=0.158 ms
64 bytes from test-rms-db.vonmaur.vmc (192.168.1.140): icmp_seq=5 ttl=64 time=0.135 ms
--- test-rms-db.vonmaur.vmc ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4001ms
rtt min/avg/max/mdev = 0.132/0.238/0.599/0.181 ms
[oracle@test-rms-app application]$
[oracle@test-rms-app application]$ uname -a
Linux test-rms-app.vonmaur.vmc 2.6.18-128.el5 #1 SMP Wed Jan 21 08:45:05 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
[oracle@test-rms-app application]$
[oracle@test-rms-app application]$ cat /etc/*-release
Enterprise Linux Enterprise Linux Server release 5.3 (Carthage)
Red Hat Enterprise Linux Server release 5.3 (Tikanga)
[oracle@test-rms-app application]$
The database is created and all the batch file scripts have been successfully deployed. Now working on the application server. The Weblogic server is installed and 11g forms and reports are installed successfully.
Any help would be helpful.
Thanks,
Ram.Please check MOS Notes:
FAQ: RWMS 13.2 Installation and Configuration (Doc ID 1307639.1) -
Use jdbc to connect servlet to oracle 8.1.6 database on win2k
The code is below:
package moreservlets;
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
/** Simple servlet used to test JDBC connection. */
public class TitleQueries extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String title = "Connecting to Database";
DriverManager.registerDriver (new
oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@pc840:1521:orcl", "scott", "tiger");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery
("select ename from emp");
while (rset.next()) {
String name = rset.getString("ename");
out.println(ServletUtilities.headWithTitle(title) +
"<body bgcolor=\"#FDF5E6\">\n" +
"<h1 align=\"center\">" + name + "</h1>\n" +
"</body></html>");
CLASSPATH=.;C:\J2ee;C:\j2sdkee1.3.1\lib\cloudscape;C:\Program Files\Apache Tomcat 4.0\common\lib\servlet.jar;C:\Oracle\Ora81\orb\classes\yoj.jar;C:\Oracle\Ora81\orb\classes\share.zip
My code cannot find the JDBC driver. Any suggestions?
Thanks.
I get the following errors:
C:\J2ee\moreservlets>javac -d "C:\Program Files\Apache Tomcat 4.0\webapps\ROOT\
EB-INF\classes" TitleQueries.java
TitleQueries.java:19: package oracle.jdbc.driver does not exist
oracle.jdbc.driver.OracleDriver());
^
TitleQueries.java:31: cannot resolve symbol
symbol : variable name
location: class moreservlets.TitleQueries
"<h1 align=\"center\">" + name + "</h1>\n" +
^
2 errorsI changed my classpath variable and my servlet
compiles okay with the:
"import oracle.jdbc.driver.*" statement.
However, I still get the following error.
Why can't it find the jdbc driver, since it finds the
import statement?
Apache Tomcat/4.0.3
Error loading driver: java.lang.ClassNotFoundException: oracle.jdbc.driver.Oracl
eDriver
WebappClassLoader: Resource '/WEB-INF/classes/moreservlets/ServletUtilities.cl
ass' was modified; Date is now: Tue Jul 02 09:57:26 CDT 2002 Was: Tue Jul 02 09:
37:20 CDT 2002
Error loading driver: java.lang.ClassNotFoundException: oracle.jdbc.driver.Oracl
eDriver
CLASSPATH=.;C:\J2ee;C:\j2sdkee1.3.1\lib\cloudscape\RmiJdbc;C:\Program Files\Apache Tomcat 4.0\common\lib\servlet.jar;C:\Oracle\Ora81\jdbc\lib\classes12.zip;C:\Oracle\Ora81\orb\classes\yoj.jar;C:\Program Files\Oracle\JDeveloper 3.2.3\jdbc\lib\oracle8.1.7\classes12.zip;C:\Oracle\Ora81\orb\classes\share.zip
//code begins here
package moreservlets;
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import oracle.jdbc.driver.*;
public class TitleQueries extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@pc840:1521:orcl", "scott", "tiger");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery
("select * from emp");
out.println(ServletUtilities.headWithTitle(title) +
"<body bgcolor=\"#FDF5E6\">");
while (rset.next()) {
out.println("<h1 align=\"center\">"
+ rset.getString("ename") + "</h1>\n");
out.println("</body></html>");
catch(ClassNotFoundException cnfe) {
System.err.println("Error loading driver: " + cnfe);
catch(SQLException sqle) {
System.err.println("Error connecting: " + sqle);
} -
Oracle 8i jdbc/Tomcat connection issues
Tomcat 4.1.8
Oracle 8i JDBC Driver
I have been able to create the DataSource as a global resource and as a local resource inside the context of the application.
The code hangs when it attempts to create a connection. I have been able to connect to the database and perform the necessary query in a standalone application to ensure that I actually can connect.
JSP Code:
<html>
<head>
<title>VTW App</title>
</head>
<body>
<%
vtw.VTWApp tst = new vtw.VTWApp();
tst.init();
%>
<h2>Results</h2>
<%= tst.getList() %>
</body>
</html>
Java Code (Class called by JSP):
package vtw;
import javax.naming.*;
import javax.sql.*;
import java.sql.*;
public class VTWApp {
String list = "EMPTY";
public void init() {
try{
Context ctx = new InitialContext();
if(ctx == null )
throw new Exception("Boom - No Context");
System.out.println("Context Created ...");
DataSource ds =
(DataSource)ctx.lookup(
"java:comp/env/jdbc/oracleDB");
if (ds != null) {
System.out.println("DataSource Created ...");
Connection conn = ds.getConnection();
System.out.println("Connection Pulled");
if(conn != null) {
System.out.println("Connection Good");
Statement st = conn.createStatement();
String query = "";
query += "select grpid, to_char(min(dtlastendtime),'mm-dd-yyyy hh24:mi:ss') ";
query += "from calc_table where equipmentsernum in (";
query += "'888000','888001'";
query += ") group by grpid";
ResultSet rs = st.executeQuery(query);
if(rs != null) {
list = "";
while(rs.next()) {
list += (rs.getString(1) + "," + rs.getString(2));
rs.close();
conn.close();
System.out.println("Connection Closed");
} else {
System.out.println("Connection Not Established");
}catch(Exception e) {
e.printStackTrace();
public String getList() { return list; }
}I figured out the issue ...
In the server.xml file the resource & resource params needed to be modified..
1. Set type to oracle.jdbc.pool.OracleDataSource
2. Set factory to oracle.jdbc.pool.OracleDataSourceFactory
3. In the Java code cast the context lookup to an OracleDataSource instead of a java.sql.DataSource
Oracles DataSource does not subclass the jdbc DataSource for its OracleDataSource class everything works fine now.
<Resource name="jdbc/mydb" scope="Shareable" type="oracle.jdbc.pool.OracleDataSource"/>
<ResourceParams name="jdbc/mydb">
<parameter>
<name>validationQuery</name>
<value></value>
</parameter>
<parameter>
<name>factory</name>
<value>oracle.jdbc.pool.OracleDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@server.company.com:1521:dbname</value>
</parameter>
<parameter>
<name>password</name>
<value>guest</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<parameter>
<name>user</name>
<value>guest</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>2</value>
</parameter>
</ResourceParams> -
Hi All,
I have been trying to connect to Oracle using a self signed certificate from a simple Java class. I am getting the below error.
main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
main, SEND TLSv1 ALERT: fatal, description = handshake_failure
I have searched many forums but couldnt find the information of my help.
Below are the steps I have followed as per the documentation in wp-oracle-jdbc-thin-ssl-130128.pdf.
First Step: Created a self signed certificate and a truststore with the below commands using JDK 1.6.0_16
Create a Keystore:
keytool -genkey -keyalg RSA -alias MyKey -keystore keystore.jks -validity 360
Extracting the public key:
keytool -export -rfc -alias MyKey -keystore keystore.jks -file public.cert
Creating the Truststore:
keytool -import -alias MyKey -file public.cert -storetype JKS -keystore keystore.truststore
Second Step: Added the following in listener.ora and sqlnet.ora
listerner.ora :
# listener.ora Network Configuration File: D:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\oracle\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
SSL_CLIENT_AUTHENTICATION = FALSE
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCPS)(HOST = localhost)(PORT = 2484))
ADR_BASE_LISTENER = D:\oracle
WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = E:\misc\Secure-jdbc\OracleCertificates)
sqlnet.ora :
# sqlnet.ora Network Configuration File: D:\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\sqlnet.ora
# Generated by Oracle configuration tools.
ENCRYPTION_WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = E:\misc\Secure-jdbc\OracleCertificates)
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (BEQ, TCPS, NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
SSL_CLIENT_AUTHENTICATION = FALSE
WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = E:\misc\Secure-jdbc\OracleCertificates)
ADR_BASE = D:\oracle\product\11.2.0\dbhome_1\log
Third Step: Created an empty auto logon wallet and added the above created certificate as a Trusted Certificate. (Imported the .cert file into the Trusted Certificates section in Wallet Manager)
Fourth Step: Used the below Java code to connect to the database using the truststore
public static void main(String[] args) { try { Class.forName("oracle.jdbc.driver.OracleDriver"); String url = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=ORCL11)))"; Properties props = new Properties(); props.setProperty("user", "system"); props.setProperty("password", "oracle"); props.setProperty("javax.net.ssl.trustStore","E:\\misc\\Secure-jdbc\\Keys and Certificates\\keystore.truststore"); props.setProperty("javax.net.ssl.trustStoreType","JKS"); props.setProperty("javax.net.ssl.trustStorePassword","sudhir123#"); Connection conn=DriverManager.getConnection(url,props); System.out.println("conn:"+conn); conn.close(); } catch(Exception e) { e.printStackTrace(); } }
Any help would be appreciated.
Thanks.
Edited by: user10569290 on 20-Feb-2013 22:02Hi EJP,
Please find the below code changes I have done to set the properties as part of System properties instead of Connection properties. I am still getting the same error.
Code:
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=ORCL11)))";
Properties systemProps = System.getProperties();
systemProps.put("javax.net.ssl.trustStore","E:\\misc\\Secure-jdbc\\Keys and Certificates\\keystore.truststore");
systemProps.put("javax.net.ssl.trustStoreType","JKS");
systemProps.put("javax.net.ssl.trustStorePassword","sudhir123#");
System.setProperties(systemProps);
Properties props = new Properties();
props.setProperty("user", "system");
props.setProperty("password", "oracle");
/*props.setProperty("javax.net.ssl.trustStore","E:\\misc\\Secure-jdbc\\Keys and Certificates\\keystore.truststore");
props.setProperty("javax.net.ssl.trustStoreType","JKS");
props.setProperty("javax.net.ssl.trustStorePassword","sudhir123#");
Connection conn=DriverManager.getConnection(url,props);
System.out.println("conn:"+conn);
conn.close();Please find the below output with the SSL debug enabled.
adding as trusted cert:
Subject: CN=Sudhir Reddy, OU=FCDMS, O=3i, L=Hyd, ST=AP, C=IN
Issuer: CN=Sudhir Reddy, OU=FCDMS, O=3i, L=Hyd, ST=AP, C=IN
Algorithm: RSA; Serial number: 0x511e1ebc
Valid from Fri Feb 15 17:10:44 GMT+05:30 2013 until Mon Feb 10 17:10:44 GMT+05:30 2014
trigger seeding of SecureRandom
done seeding SecureRandom
%% No cached client session
*** ClientHello, TLSv1
RandomCookie: GMT: 1361369602 bytes = { 14, 223, 155, 241, 143, 72, 188, 240, 205, 158, 201, 133, 217, 192, 95, 82, 61, 244, 93, 100, 12, 9, 232, 164, 116, 206, 30, 142 }
Session ID: {}
Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA]
Compression Methods: { 0 }
main, WRITE: TLSv1 Handshake, length = 73
main, WRITE: SSLv2 client hello message, length = 98
main, received EOFException: error
main, handling exception: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
main, SEND TLSv1 ALERT: fatal, description = handshake_failure
main, WRITE: TLSv1 Alert, length = 2
main, called closeSocket()
main, called close()
main, called closeInternal(true)
java.sql.SQLRecoverableException: IO Error: Remote host closed connection during handshake
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:466)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:535)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:218)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:29)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at SecureJDBC.getSecureConnection(SecureJDBC.java:52)
at SecureJDBC.main(SecureJDBC.java:15)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:808)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1096)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:623)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
at oracle.net.ns.Packet.send(Packet.java:421)
at oracle.net.ns.ConnectPacket.send(ConnectPacket.java:170)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:302)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1407)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:328)
... 8 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:333)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789)
... 16 more -
Connection reset using JDBC Oracle thin Driver (towards 10g DB)
Hi we have a home-grown application and a Oracle 10g (10.2.0.1) database.
We created a scheduled servlet that gets a JDBC connection from a persistent connected cache (an OracleDataSource object registered using OracleConnectionCacheManager). The servlet runs every 15 minutes and runs the query "SELECT SYSTIME FROM DUAL" on 10g Database as XYZ user. The datapool was created yday on web-app and all queries ran successfully for about 5 hours after which it reported a connection reset error.
I can then conclude that we cannot keep the server session alive for the JDBC client by running frequent SQL queries.
We didnt get any messages on the DB server side that indicate the release of the session
Ultimately, we are struggling with reset connections from our applications that are
using the JDBC thin oracle driver; after a couple of hours of idle
connections, we receive the below error from the JDBC driver:
Jul 5, 2007 10:59:53 AM oracle.jdbc.driver.DatabaseError throwSqlException
WARNING: DatabaseError.throwSqlException(e): Unable to find ORA number from
exception Jul 5, 2007 10:59:53 AM oracle.jdbc.driver.DatabaseError
findMessage
WARNING: DatabaseError.findMessage(errNum, obj): returned Io exception:
Connection reset Jul 5, 2007 10:59:53 AM
oracle.jdbc.driver.PhysicalConnection getWarnings
INFO: PhysicalConnection.getWarnings()
Any suggestions please ?
VkThe 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? -
How to use JDBC to connect Oracle databse
Hi
I try to connect the oracle databse by using JDBC. But I not sure whether is it correct or not because I learnt from the documentation provided by WWW.JAVA.SUN.
I have create a ODBC DSN file call TKS username/password : tem/manager
then I download the source code and enhance a bit as following :
import java.sql.*;
public class CreateCoffees
public static void main(String args[])
String url = "jdbc:oracle:thin:tem/manager@(
description=(address_list=(
address=(protocol=tcp)
(host=192.9.200.8)(port=1521)))(source_route=yes)
(connect_data=(sid=tks)))";
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("oracle.jdbc.driver.OracleDriver");
catch(java.lang.ClassNotFoundException e)
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
try {
con = DriverManager.getConnection(url, "tem", "manager");
stmt = con.createStatement();
stmt.executeUpdate(createString);
stmt.close();
con.close();
catch(SQLException ex)
{ System.err.println("SQLException: " + ex.getMessage());
After that I saved the file as CreateCoffees.java and compiled it
D:\KLTAY\JAVA>javac CreateCoffees.java
CreateCoffees.java:6: unclosed string literal
String url = "jdbc:oracle:thin:tem/manager@(
^
CreateCoffees.java:10: unclosed string literal
(connect_data=(sid=tks)))";
^
CreateCoffees.java:30: cannot resolve symbol
symbol : variable con
location: class CreateCoffees
con = DriverManager.getConnection(url, "tem", "manager");
^
CreateCoffees.java:31: cannot resolve symbol
symbol : variable con
location: class CreateCoffees
stmt = con.createStatement();
^
CreateCoffees.java:34: cannot resolve symbol
symbol : variable con
location: class CreateCoffees
con.close();
^
5 errors
Please give some advise.Thanks
best regards,
TayString url = "jdbc:oracle:thin:tem/manager@(
description=(address_list=(
address=(protocol=tcp)
(host=192.9.200.8)(port=1521)))(source_route=yes)
(connect_data=(sid=tks)))";
After that I saved the file as CreateCoffees.java and
compiled it
D:\KLTAY\JAVA>javac CreateCoffees.java
CreateCoffees.java:6: unclosed string literal
String url = "jdbc:oracle:thin:tem/manager@(
^
CreateCoffees.java:10: unclosed string literal
(connect_data=(sid=tks)))";
^I would suggest putting all code between the quotesj(") on one line and then attempting to recompile. -
-How to use JDBC to connect the SQLServer and Oracle.
Hi,
I create a table in the WIP DB, I want to modify this table when use "PRE-START" activity in POD.
SAPME version: 5.2.3.4 SDK:2.0 DB:SQL2005 and Oracle 10.2g
SourceCode like below:
public void execute(StartHookDTO dto) throws Exception {
initServices();
try{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=SAPMEWIP", "sa" ,"sap12345");
conn.close();
}catch(Exception e){
e.printStackTrace();
Besides, I already setup the JDBC ClassPath in ConfigTool, but it gets somes error when executing.
the error code like below:
java.sql.SQLException: No suitable driver
Please give me some support or a example, thank you so much!
Br,
AlexYou probably want to use the WIP Datasource defined in JNDI.
-
How to use jdbc to connect oracle
I want use jdbc direct to connect oracle database,and I
want to use sun Company or oracle Company driver. how can I get driver and how do I write connection string?
Deeply to wait your reply,thank you!The correct format would be jdbc:oracle:thin@server:port:sidTry "jdbc:oracle:thin:@192.168.84.20:1521:ORDB","ysys","fareast"and see what happens.
Note that you two formats for the DriverManager.getConnection() method; if DriverManager.getConnection(db_url, username, password) doesn't work, try the other call with a fully-qualified database url:DriverManager.getConnection("jdbc:oracle:thin:ysys/[email protected]:1521:ORDB")The SID is the server ID that was given to the instance when the database was installed; default is ORCL, but may have been changed. Port default is 1521, but again, this may be different for your system. -
ATG CIM: Not able to connect to database jdbc:oracle:thin
Hi All,
I am trying to setup a ATG environment on windows boxes. Below is the setup:
VM1) DC - Windows Domain Controller (Windows Server 2008)
VM2) javadb - Oracle 11g (Windows Server 2008)
VM3) javaweb - ATG 10.0.3 / WebLogic wlserver_10.3/ TomCat 7 (Windows Server 2008)
Installation / Setup Progress
* Oracle 11g installation successful. Sample DB successfully created.
* WebLogic installation successful. Base_Domain successfully created.
* Able to create successful connection to Oracle (javadb vm) from TomCat (javaweb vm) and query data
Error: When configuring CIM I keep on getting >> "Not able to connect to database jdbc:oracle:thin:@javadb:1521:SampleDB @ scott"+_
Corrective action already taken:
1) Disabled firewall on all boxes
2) Added path of JDBC driver (ojdbc6.jar) in Environment Variables
3) Tested Oracle 11g (javadb vm) connectivity both from Eclipse and Tomcat. Which is successful
4) Cleared all files under C:\ATG\ATG10.0.3\CIM\data to reset CIM
Please refer CIM details below:
===========================================
CIM DISPLAY START
===========================================
-------ENTER CONNECTION DETAILS-----------------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Production Core
Select Database Type
*[1] Oracle Thin
[2] MS SQL
[3] iNet MS SQL
[4] DB2
[5] My SQL
Select one > 1
Enter User Name [[system]] > scott
Enter Password [[**********]] > **********
Re-enter Password > **********
Enter Host Name [[javadb]] > javadb
Enter Port Number [[1521]] > 1521
Enter Database Name [[sampledb]] > SampleDB
Enter Database URL [[jdbc:oracle:thin:@javadb:1521:SampleDB]]
>
Enter Driver Path [[C:/Oracle/Middleware/wlserver_10.3/server/lib/ojdbc6.jar]]
Enter JNDI Name [[ATGProductionDS]] >
-------CONFIGURE DATASOURCE PRODUCTION CORE-----------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
[C] Connection Details - Done
*[T] Test Connection
[S] Create Schema
Import Initial Data
[D] Drop Schema
[O] Configure Another Datasource
> T
-------TEST DATASOURCE CONNECTION---------------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Production Core
>> Not able to connect to database jdbc:oracle:thin:@javadb:1521:SampleDB @ scott
===========================================
CIM DISPLAY END
===========================================
===========================================
CIM LOG START
===========================================
**** Warning Mon Jul 23 22:46:25 IST 2012 1343063785645 atg.cim.worker.status.StatusUpdateValidator Status id nonswitchingCore-DatasourceConnectionTemplateStep is unknown.
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator Not able to connect to database jdbc:oracle:thin:@javadb:1521:SampleDB : -1 java.lang.ArrayIndexOutOfBoundsException: -1
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.T4CTTIoauthenticate.setSessionFields(T4CTTIoauthenticate.java:948)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.T4CTTIoauthenticate.<init>(T4CTTIoauthenticate.java:225)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:358)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:538)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:228)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at java.sql.DriverManager.getConnection(DriverManager.java:582)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at java.sql.DriverManager.getConnection(DriverManager.java:185)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.BasicDataSource.getDriverManagerConnection(BasicDataSource.java:526)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.BasicDataSource.getDriverManagerConnection(BasicDataSource.java:588)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.BasicDataSource.getConnection(BasicDataSource.java:475)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.FakeXADataSource.getXAConnection(FakeXADataSource.java:671)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.MonitoredDataSource.createResource(MonitoredDataSource.java:837)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.resourcepool.ResourcePool.populateSlot(ResourcePool.java:2064)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.resourcepool.ResourcePool.checkOut(ResourcePool.java:1332)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.MonitoredDataSource.co(MonitoredDataSource.java:1792)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.service.jdbc.MonitoredDataSource.getConnection(MonitoredDataSource.java:1070)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.worker.databaseconfig.TestJdbcConnectionValidator.performTestConnection(TestJdbcConnectionValidator.java:319)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.worker.databaseconfig.TestJdbcConnectionValidator.validate(TestJdbcConnectionValidator.java:266)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.executeValidations(StepExecutor.java:280)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.ui.text.TextDisplay.processStep(TextDisplay.java:338)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.ui.UIDispatchImpl.processStep(UIDispatchImpl.java:89)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processStep(StepExecutor.java:201)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processCurrentStep(StepExecutor.java:80)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.runner.Runner.run(Runner.java:152)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.types.LaunchTemplate.execute(LaunchTemplate.java:69)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.execute(CommandExecutor.java:128)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.executeCommands(CommandExecutor.java:156)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processStep(StepExecutor.java:129)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processCurrentStep(StepExecutor.java:80)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.runner.Runner.run(Runner.java:152)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.types.LaunchTemplate.execute(LaunchTemplate.java:69)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.execute(CommandExecutor.java:128)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.executeCommands(CommandExecutor.java:156)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processStep(StepExecutor.java:129)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processCurrentStep(StepExecutor.java:80)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.runner.Runner.run(Runner.java:152)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.types.LaunchTemplate.execute(LaunchTemplate.java:69)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.execute(CommandExecutor.java:128)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.executeCommands(CommandExecutor.java:156)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processStep(StepExecutor.java:129)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processCurrentStep(StepExecutor.java:80)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.runner.Runner.run(Runner.java:152)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.types.LaunchWizard.execute(LaunchWizard.java:73)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.execute(CommandExecutor.java:128)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.command.CommandExecutor.executeCommands(CommandExecutor.java:156)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processStep(StepExecutor.java:216)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.step.StepExecutor.processCurrentStep(StepExecutor.java:80)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.runner.Runner.run(Runner.java:152)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.flow.CimFlow.startupFlow(CimFlow.java:69)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.flow.CimFlowCreator.startDefaultCimFlow(CimFlowCreator.java:78)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.Launcher.startCimFlow(Launcher.java:168)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator at atg.cim.Launcher.main(Launcher.java:68)
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792213 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator
**** Error Mon Jul 23 22:46:32 IST 2012 1343063792218 atg.cim.worker.databaseconfig.TestJdbcConnectionValidator Error initializing connection from parameters. Test for jdbc connection failed
===========================================
CIM LOG END
===========================================
Any suggestion how to resolve this issue. Thanks in advance.
cheers,
Sandeep
Edited by: 948180 on Jul 23, 2012 11:29 PMHi,
Earlier my ojdbc6.jar path was not at the beginning of ClassPath. I have made necessary changes. Please refer below:
Environment Variables Settings on machine where CIM resides:
PATH = C:\Oracle\Middleware\wlserver_10.3\server\lib\ojdbc6.jar+;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Java\jre7\bin;C:\Program Files\Apache Software Foundation\Tomcat 7.0\bin;C:\Program Files\cvsnt;C:\Program Files\Java\jdk1.7.0\bin;C:\Program Files\Sun\JavaDB\bin;C:\Program Files\Sun\JavaDB\lib;;C:\ATG\ATG10.0.3\MySQL\win32\bin;C:\ATG\ATG10.0.3\home\bin\;C:\Oracle\Middleware\wlserver_10.3\server\lib\;
Note: I have verified by ojdbc6.jar path.
Below are the precise steps I executed after updating my environment variables and restarting CMD.
===========================================
CIM DISPLAY START
===========================================
C:\ATG\ATG10.0.3\home\bin>cim.bat
Nucleus running
_ | () |
__ _ | |_ __ _ ----
/ _` | | __| / _` |
| (_| | | |_ | (_| |
\__,_| \__| \__, |
|___/
Configuration Installation Manager
=======CIM MAIN MENU============================================================
enter [h]elp, [q]uit to exit
Choose the task you want to perform:
*[1] Database Configuration
[2] Server Instance Configuration
[3] Application Assembly & Deployment
[P] Product Selection - Done (ATG B2C Commerce)
[A] Select Application Server - Done (Weblogic Online)
[C] Custom CIM Plugin Launcher
> 1
-------CALCULATE DATASOURCE DEPENDENCIES----------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Calculating Datasource Dependencies. View log file at C:/ATG/ATG10.0.3/home/
../CIM/log/cim.log
|. . |
|. . |
-------SELECT A DATASOURCE TO CONFIGURE-----------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
*[P] Publishing
[C] Production Core
[D] Done
> c
-------CONFIGURE DATASOURCE PRODUCTION CORE-------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
[C] Connection Details - Done
*[T] Test Connection
[S] Create Schema
Import Initial Data
[D] Drop Schema
[O] Configure Another Datasource
> t
-------TEST DATASOURCE CONNECTION-----------------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Production Core
>> Not able to connect to database jdbc:oracle:thin:@javadb:1521:SampleDB @
scott
*[E] Edit Connection Details
[R] Redo
[D] Done
> e
-------RE-USE VALUES FROM PREVIOUS DATASOURCE-----------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Production Core
Base on previous database details:
[1] system@jdbc:oracle:thin:@javadb:1521:sampledb
[2] scott@jdbc:oracle:thin:@javadb:1521:SampleDB
*[3] None/Use Existing
Select one > 2
-------ENTER CONNECTION DETAILS-------------------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Production Core
Select Database Type
*[1] Oracle Thin
[2] MS SQL
[3] iNet MS SQL
[4] DB2
[5] My SQL
Select one > 1
Enter User Name [[scott]] > scott
Enter Password [[**********]] > **********
Re-enter Password > **********
Enter Host Name [[javadb]] > javadb
Enter Port Number [[1521]] > 1521
Enter Database Name [[SampleDB]] > SampleDB
Enter Database URL [[jdbc:oracle:thin:@javadb:1521:SampleDB]]
> jdbc:oracle:thin:@javadb:1521:SampleDB
Enter Driver Path [[C:/Oracle/Middleware/wlserver_10.3/server/lib/ojdbc6.jar]
] > C:\Oracle\Middleware\wlserver_10.3\server\lib\ojdbc6.jar
Enter JNDI Name [[ATGProductionDS]] > ATGProductionDS
-------CONFIGURE DATASOURCE PRODUCTION CORE-------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
[C] Connection Details - Done
*[T] Test Connection
[S] Create Schema
[I] Import Initial Data
[D] Drop Schema
[O] Configure Another Datasource
> T
-------TEST DATASOURCE CONNECTION-----------------------------------------------
enter [h]elp, [m]ain menu, [q]uit to exit
Production Core
>> Not able to connect to database jdbc:oracle:thin:@javadb:1521:SampleDB @
scott
*[E] Edit Connection Details
[R] Redo
[D] Done
>
===========================================
CIM DISPLAY END
===========================================
Don't understand what could possibly be going wrong.
Cheers,
Sandeep
Edited by: 948180 on Jul 24, 2012 12:23 AM
Maybe you are looking for
-
I am trying to simulate the robot voice synthesizer sound that is produced by that electronic voice simulator after someone as had their voice box removed. The vocal transformer insert in Logic Pro doesn't quite do it. Any Suggestions?
-
Recording records from stero using gb
i was able to record the record succesfully from my stereo to my computer but i'm having trouble breaking down the album into multiple tracks. Right now when i put it into my itunes it shows as one 30 minute track instead of 13. any advice would be g
-
Best way to collect periodic data over RS232?
I'm using Labview 6i to collect data from a device over RS232. The device manual says that it delivers data digitally by sending 10 bytes every 100ms. I'm using VISA Write to send an initialization string, and then I step in to a loop containing VI
-
Compressor 3.5.3 won't letterbox or remember saved Padding settings
I'm taking a screen capture out of ScreenFlow into Compressor 3.5.3 and I cannot get it to letterbox to 16 x 9. I'm not new to Compressor and have tried everything I can think of and done numerous searches searches with no success. -Original Pro Res
-
Adobe PDF Print Engine2 Supported in VxWorks?
I am planning to Integrate Adobe PDF Print Engine in MFP/Printer for printing of PDF/Postscript Files. Can this be deployed in VxWorks. (i.e. can I deploy PDF Print Engine2 in VxWorks Environment).