JDBC Connectivity with Oracle:
Hi!
I am trying to find a driver for oracle 8i. I want connect to an oracle database from Home. I am want the driver work both locally and on the server. I went to oracle.com I couldn't get it. The links are bronken. Please let me know where can I get a free driver for oracle. Please either give me a like or email it to [email protected]
Thanks,
Michael
You need to load the driver first as follows:
Class.forName(oracle.jdbc.driver.OracleDriver);
Then jdbc url :
Connection connection = DriverManager.getConnection(jdbc:oracle:thin:@oraclehostname/IP Address of oracle server:1521:Oracle SID,username,password)
Go forward!!!
Similar Messages
-
Problem in getting jdbc connection with oracle for win 98
This is my code given below
import java.sql.*;
public class Oconnection
Connection conn;
Statement st;
PreparedStatement pst,pstissue,pstret,pstbook;
public Oconnection()
try
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","system","manager");
catch(Exception ex)
System.out.println(ex.getMessage());
ex.printStackTrace();
public static void main(String args[])
new Oconnection();
*****************************************************8
Error
C:\Library>java Oconnection
Io exception: The Network Adapter could not establish the connection
java.sql.SQLException: Io exception: The Network Adapter could not establish the
connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:211)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:324)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:266)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:365)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at Oconnection.<init>(Oconnection.java:17)
at Oconnection.main(Oconnection.java:39)
I am using Oracle for win95 or i think it is oarcleforwin98 .
The sid of my database i found through query given was orcl, what changes should i do in the code so that it works.
should i use another driver coz i am using latest driver from oracle.com which is for oracle 8i. if a need a driver change where can i download it from please help mehttp://forum.java.sun.com/thread.jsp?thread=291584&forum=48&message=1305045
-
Using multipool Connections with Oracle 8i OPS Parallel Server
Does anyone have any experience using multipool JDBC connections with Oracle 8i OPS? During a oracle node failure, we are seeing all of the connections fail. Any help you could give me her would be greatly appreciated!
hal lavender wrote:
Hi,
I am trying to achieve Load Balancing & Failover of Database requests to two of the nodes in 8i OPS.
Both the nodes are located in the same data center.
Here comes the config of one of the connection pools.
<JDBCConnectionPool CapacityIncrement="5" ConnLeakProfilingEnabled="true"
DriverName="oracle.jdbc.driver.OracleDriver" InactiveConnectionTimeoutSeconds="0"
InitialCapacity="10" MaxCapacity="25" Name="db1Connection598011" PasswordEncrypted="{3DES}ARaEjYZ58HfKOKk41unCdQ=="
Properties="user=ts2user" Targets="ngusCluster12,ngusCluster34" TestConnectionsOnCreate="false"
TestConnectionsOnRelease="false" TestConnectionsOnReserve="true" TestFrequencySeconds="0"
TestTableName="SQL SELECT 1 FROM DUAL" URL="jdbc:oracle:thin:@192.22.11.160:1421:dbinst01" />
<JDBCConnectionPool CapacityIncrement="5" ConnLeakProfilingEnabled="true"
DriverName="oracle.jdbc.driver.OracleDriver" InactiveConnectionTimeoutSeconds="0"
InitialCapacity="10" MaxCapacity="25" Name="db2Connection598011" PasswordEncrypted="{3DES}ARaEjYZ58HfKOKk41unCdQ=="
Properties="user=ts2user" Targets="ngusCluster12,ngusCluster34" TestConnectionsOnCreate="false"
TestConnectionsOnRelease="false" TestConnectionsOnReserve="true" TestFrequencySeconds="0"
TestTableName="SQL SELECT 1 FROM DUAL" URL="jdbc:oracle:thin:@192.22.11.161:1421:dbinst01" />
<JDBCMultiPool AlgorithmType="Load-Balancing" Name="pooledConnection598011"
PoolList="db1Connection598011,db2Connection598011" Targets="ngusCluster12,ngusCluster34" />
Please let me know , if you need further information
HalHi Hal. All that seems fine, as it should be. Tell me how you
enact a failure so that you'd expect one pool to still be good
when the other is bad.
thanks,
Joe -
Problem in connecting with Oracle
hi everybody
I have a problem in connecting with Oracle express 10g. I got an error that doesn't allow me to connect. hope anyone can help me and solve this problem
--------------------Configuration: test - JDK version 1.6.0_20 <Default> - <Default>--------------------
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at DB.dbConnect(test.java:36)
at test.main(test.java:18)
this is the code that I'm following
import java.io.*; import java.sql.*; public class test2 { public static void main(String[] args) { try { Connection con=null; Class.forName("oracle.jdbc.driver.OracleDriver"); con=DriverManager.getConnection( "jdbc:oracle:thin:@PLANET:1521:ORCL", "scott", "tiger"); Statement s=con.createStatement(); s.execute("INSERT INTO BOOKS VALUES('A Tale of Two Cities','William Shakespeare',4567891231,'05-JAN-1962')"); s.close(); con.close(); } catch(Exception e){e.printStackTrace();} } }
Edited by: Vantasia on Nov 12, 2010 10:18 AM1. Is the connection url correct?
"jdbc:oracle:thin:@PLANET:1521:ORCL" is fine.
2. Is the TNS listener started?
c:\oracle\product\ora10\bin> lsnrctl status
3. Is a firewall between client and database server?
Connection url with firewall would be different.
http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/jdbcthin.htm#i1004276 -
Cannot establish connection with Oracle database
Hello
This is the first time I use BOE server with Crystal Report to execute some tests, and one issue is blocking me now, and I am not even sure if this is the right Forum where I should post it.
I installed BOE server XI 3.1 SP4 on Linux machine (new installation), and then I uploaded some existing Crystal Report templates that are working fine on another BOE server. Those CR templates have to establish a connection with a remote Oracle database to get the data, and we pass all credentials for this purpose.
The first time I run my first test I received this error that I could not find anywhere on the web :
ErrorLog 2011 8 10 7:05:52.505 14215 356 (Administrator:82) (../reporthandler.cpp:12462): CReportHandler::buildReportViewerError: CSResultExceFailed to open the connection." FileName:"../reporthandler.cpp" LineNum:12458 ErrorCode:756 ErrorMsg:"Failed to open the connection.
{FBAD55EE-BEAF-11E0-BC1C-005056813A72}.rpt" DetailedErrorMsg:""
I believe that the CR was not able to establish the connection with Oracle, so I install Oracle Client on the same machine (test remote connection ==> pass), I set the ORACLE_HOME variable, and I edit the file <installation_home>/ bobje/java/CRConfig.xml to add the path to ojdbc14.jar, and finnaly restart the tomcat server. However I am still getting the same error message.
Is there any hint that can help me troubleshooting this issue?
Thank youdo the reports use native oracle connectivity or JDBC ?
what version of Oracle client did you install ?
was it 32bit or 64bit client ?
what your LD_LIBRARY_PATH variable set to ?
what does it say in the CMC when you look at CR report's DB properties ? -
Remote JDBC Problem with Oracle BPM Studio
Hi all, i am facing the Remote JDBC Problem with Oracle BPM Studio.
When i configure a Remote JDBC Connection for SQL in BPM Studio, it prompt me an error.
The SQL Connection is configured as following :
External Resource:
Name : MyDS
Type : SQL Database
Supported Types : Remote JDBC
Details:
Database Type : BPM's Oracle Driver Version:10, 11
J2EE : WLS
Lookup Name : MyAppDS
Configuration for "WLS"
Name : WLS
Type : J2EE Application Server
Supported Types : GENERIC_J2EE
Details:
Initial Context Factory : weblogic.jndi.WLInitialContextFactory
URL : t3://localhost:7001
But, when i try to connect to the Database by using this configuration, I will get an Exception.
An exception occurred while getting a resource from a connector.
Detail:The connector [[ MyDS : SQL : REMOTE_JDBC ]] caused an exception when getting a resource.
Caused by: An exception occurred while getting a resource from a connector.
Detail:The connector [[ WLS : J2EE : J2EE ]] caused an exception when getting a resource.
Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory [[ Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory ]]
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at fuego.jndi.FaultTolerantContext.createContext(FaultTolerantContext.java:726)
at fuego.jndi.FaultTolerantContext.<init>(FaultTolerantContext.java:79)
at fuego.connector.impl.GenericJ2EEConnector.createInitialContext(GenericJ2EEConnector.java:177)
at fuego.connector.impl.GenericJ2EEConnector.createStandaloneContext(GenericJ2EEConnector.java:98)
at fuego.connector.impl.BaseJ2EEConnector.getResource(BaseJ2EEConnector.java:92)
at fuego.connector.impl.BaseJ2EEConnector.getResource(BaseJ2EEConnector.java:76)
at fuego.connector.J2EEHelper.getReadOnlyContext(J2EEHelper.java:86)
... 12 more
Edited by: user2262377 on Jun 22, 2009 4:01 PMI guess the weblogic.jar is not included in the studio.
So, i added weblogic.jar (Weblogic 10.3) and wlclient.jar (Weblogic 10.3)
It is working in my simple java code. But, still not working in BPM Studio.
The error logs:
An exception occurred while getting a resource from a connector.
Detail:The connector [OFT_APP_DS:SQL:REMOTE_JDBC] caused an exception when getting a resource.
Caused by: java.lang.Object cannot be cast to java.io.Serializable
fuego.connector.ConnectorException: An exception occurred while getting a resource from a connector.
Detail:The connector [OFT_APP_DS:SQL:REMOTE_JDBC] caused an exception when getting a resource.
at fuego.connector.ConnectorException.exceptionOnGetResource(ConnectorException.java:88)
at fuego.connector.JDBCHelper.getReadOnlyConnection(JDBCHelper.java:93)
at fuego.sqlintrospector.BrowserPanel.connect(BrowserPanel.java:395)
at fuego.sqlintrospector.BrowserPanel.populateTree(BrowserPanel.java:200)
at fuego.ui.wizards.ui.CheckTreeBrowser$1.construct(CheckTreeBrowser.java:63)
at fuego.ui.SwingWorker$2.run(SwingWorker.java:39)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException: java.lang.Object cannot be cast to java.io.Serializable
at weblogic.iiop.IIOPOutputStream.writeAny(IIOPOutputStream.java:1588)
at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2231)
at weblogic.utils.io.ObjectStreamClass.writeFields(ObjectStreamClass.java:413)
at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:235)
at weblogic.corba.utils.ValueHandlerImpl.writeValueData(ValueHandlerImpl.java:225)
at weblogic.corba.utils.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:182)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:1963)
at weblogic.iiop.IIOPOutputStream.write_value(IIOPOutputStream.java:2001)
at weblogic.iiop.IIOPOutputStream.writeObject(IIOPOutputStream.java:2266)
at weblogic.jdbc.common.internal.RmiDataSource_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173) -
How to connect with Oracle in java
Hello!
I would like to use java for my graduation project. And connect with Oracle in java.
I used j2sdk1.4.2_04 and Oracle 9i release 9.2.0.1.0
May I ask where could supply me information or content ?
Thanks!!hi jus a sample code
public class DbUtil {
// Connection instance
private static Connection conn = null;
private Object connection;
public DbUtil() {
// Connect to the database
dbConnect();
* This method performs the clean up action and closes the application
void exitDbUtil(){
// If connected to database
if (conn != null) {
try {
// Close the connection
conn.close();
conn=null;
catch (Exception ex){ // Trap errors
System.out.println(" Error while Closing the connection: "+ex.toString());
* Creates a database connection object
private void dbConnect() {
try {
String driverName = "oracle.jdbc.driver.OracleDriver";
Class.forName(driverName);
String url = "jdbc:oracle:thin:@" + ConnectionParams.s_hostName +
":" + ConnectionParams.s_portNumber +
":" + ConnectionParams.s_databaseSID;
// Create a connection object
conn = DriverManager.getConnection(url, ConnectionParams.s_userName,
ConnectionParams.s_password);
catch(Exception e){ -
The network adapter could not establish the connection with Oracle
I installed Oracle in my laptop (windows 2008), and install Hyperion 11.1.2, when I configure Hyperion, it pops up with "the network adapter could not establish the connection with Oracle"?
Hi,
This usually means that the connection details you have put in for Oracle are incorrect or Oracle can not be contacted.
Double check your configuration connection details and make sure you can access Oracle using them details.
Cheers
John
http://john-goodwin.blogspot.com/ -
DB2 OS400 Connection with Oracle Reports 9i with Windows XP
Dear Friends
I have a valid ODBC connection of DB2 OS400 and i am using the same with Crystal Report i want to use the same connection with oracle Reports 9i & Forms 9i.
The response will be highly appriciated.
Rgds
Muhammad Tahir Khanduplicate post.
DB2 OS400 Connection with Oracle Reports -
Forms 6i is not connecting with Oracle 11g database?
Forms 6i is not connecting with Oracle 11g database?
How to resolve this issue?Hi,
Once you installed the Forms and Reports, you need to configure the paramters like tnsnames.ora in you path.
There will be one folder in the Installation path of Forms and Reports search for tnsnames.ora file..and you need to Updated the file as per the which ORACLE Server you are connecting and then try.. it..
Default path for forms will be "ORACLE_HOME/net80/admin".. search for tnsnames.ora and modify it..
- Pavan Kumar N -
Exmpl of Servlet connect with ORacle
Hi folks,
Can anyone send me example of Java Servlet connectivity with Oracle.
i m not able to connect servlet with oracle.
u guys can reply me on [email protected]
thanks
dal hitNo.
The code for connecting to Oracle from a Servlet is no different from connecting to Oracle from any other Java application. So tell you what, you show us what you've tried and the error message(s) and we'll help you debug it.
99.999% of the time it's a failure to put the driver Jar file into the classpath, the specifics of which vary from application server to application server. Which one are you using?
u guys can reply me on [email protected]
We can, but we won't. This is not your personal bugfixing service. Pay if you want that kind of help. If you want it for free, do it through the forums or go away.
Probably you'll never read this response, but that's your problem not mine. -
"stack overflow" when trying to connect with Oracle ODBC
Hi,
I'm trying to connect to Oracle DB (8.1.7.3.0) from WinNT 4.0 SP6 with Oracle ODBC driver 8.0.6.6.0. I've been trying to connect with "Oracle ODBC Test" and with "MS Query". In either way I end up with Dr. Watson reporting about "stack overflow". Before starting to upgrade ODBC driver I wanted to ask - should these versions of driver and DB work together at all (even unofficially)? Or may I be missing some other thing? Any hints, ideas are welcome.
Regards,
Madis PriilinnThank You for replying, Justin!
Yes, I can connect successfully to the database through other tools - at the moment I tried SQL*Plus, Net8 Easy Config and Schema Manager.
The Oracle client in the NT machine is 8.0.5.0.0. And unfortunately I do not know anything about the Oracle installation on this machine and at the moment I don't have that person near me too whom to ask also. But I think the installation was ok, because the connection through ODBC was working before the DB upgrade as far as I understood (sorry, again at the moment I don't know what was the previous version of DB. I will ask that information as soon as possible).
The main problem that bothers me at the moment is that I can't install 8.1.* series OraODBC driver with 8.0.5.0.0 Oracle Installer. I managed to install 8.0.6.6.0 version of the driver, but not the newer ones. As far as I've understood I have to upgrade the whole Oracle in the NT machine to upgrade that installer. Am I correct?
Regards,
Madis Priilinn -
Howmany oracle user connect with oracle server.
hi all
howmany oracle user connect with oracle server.
i want query for above sentance.Robert,
This query will show us the username who are connect to a particular database. If OP wants that how many overall users are connected to his/her oracle server (which is having more than one db) then please tell us. Suppose 10 users are connected with db1 and 20 users are connected with db2.. like that.
Regards
Girish Sharma -
Will there be a new preview of jdev 10.1.3 in connection with Oracle OpenWorld???
Supporting binding and ADF....Please!
JohnnyThanks a lot to all the jdev team fot the efforts to put a new preview available ... we are really very excited to continue exploring (using) adf faces, data controls, ejb 3.0 or adf bc and all these necessary thinks we need to develop new modern software to address the business needs our customers.
-
CC - Connecting with Oracle ERP
Hi Expert!
Do anyone have connect Compliance Calibrator with Oracle???
I need some guide with the data extraction! can any one help me please? If anyone have some guide or steps to follow it would be perfect...
Regards,
MagalyMagaly,
You need to use Greenlight Adapters to support GRC connection with oracle, jde and peoplesoft.
Please refer the following SAP Note for the supporting versions.( I don't have any documentation)
Note 1076755 - Greenlight Adapters- Versions of ORA, JDE and PS Supported
Thanks
Himadama
Maybe you are looking for
-
My iphone is broken and i am getting a new one sent out. How do i get everything from my old phone copied to the new one so its exactly the same??
-
13" macbook pro can't detect tv
So once again I am wondering if anyone can offer a solution for this problem; my 13'' macbook pro will not detect any tv that it is connected to. I have tried both a 42'' Vizio and a 40" Samsung. I got it to connect two times, and then nothing. Hel
-
Adding up a Custom Field Approver in Purchase Requisition
Hi, Could anyone please let me know how to addup a custom field Approver to Purchase Requistion. Requesting you to list down the User enhancements that are available for PR Lineitems screen. The transaction used is ME51N. Regards, Ganga
-
Where to download Digital Editions SDK 1.7.2 for MAC
Digital Editions SDK 1.7.2 is supposed to be available. However, when I download the SDK from the developer center I get version 1.7.1. Someone knows where to find 1.7.2? 1.7.1 does not work with Mac OSX 10.7, but the installer here seems to work, so
-
Costing issue-Why Info record price is not read ?
Hi, We have an issue while costing a Material procured externally. Valuation Variant >>> Priority 1-Info record price. >>Priority 2-Material Master valuation price. However, system is picking the price matained in the Material master. I have verified