Establishing connection to Oracle

Hi all. I've just started with JDBC and Oracle 10g.
In book "Java programming with Oracle Jdbc" they told me to start with adding to CLASSPATH classesXXX.zip.
1) I found Oracle_Home\jdbc\lib\classes12.zip as I understand it is for java 1.2 version, but I am using java 1.6.
2) How to add to classpath file? I am using Eclipse IDE.
Thanks in advance.

America70 wrote:
Hi all. I've just started with JDBC and Oracle 10g.
In book "Java programming with Oracle Jdbc" they told me to start with adding to CLASSPATH classesXXX.zip.That's an old book.
>
1) I found Oracle_Home\jdbc\lib\classes12.zip as I understand it is for java 1.2 version, but I am using java 1.6.
Yes, you can get a more modern JDBC driver here:
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
2) How to add to classpath file? I am using Eclipse IDE.I haven't used Eclipse in a while, but if I remember correctly you right click on the project root, select "Properties", and add the path to the 3rd party JAR to your CLASSPATH there.
%

Similar Messages

  • 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 you

    do 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 ?

  • Unable to establish connection to oracle database using sql developer

    hi guys,
    i tried to connect to the oracle database using the sql developer, but it fails. it replies the following message:
    Status: Failure -Test failed: Io exception: The Network Adapter could not establish the connection
    what should i do? any help

    Please provide a little more information:
    1) SQLDeveloper version.
    2) Database Version.
    3) Database location (same machine or on the network).
    4) Connection method (basic,TNS).
    5) Connection type (Thin,Thick/OCI).
    Usually the first thing to check is if you have correctly entered the right information for your database connection, then if everything seems to be OK the database itself should be checked for potential problems.

  • How to establish connection with oracle........

    Hi,
    I'm using ODBC driver and
    I've given
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection cn=DriverManager.getConnection("jdbc:odbc:mydatabase","scott","tiger");
    where mydatabase is the datasource name,scott is the user name,tiger is the password.
    while running I got the error as:
    java.sql.SQLException:[Oracle][ODBC][Ora]ORA-12560:TNS:protocol adaptor error.
    I don't know how to solve this one.
    Should I give the "ServiceName" while creating my datasource name............?????
    Can anyone help me...........
    Thanks in Advance.
    Subha.

    There are a couple of things that you might need to take into account while using the ODBC. Firstly, you need to set up an ODBC connection to the database. Secondly, you need to have the tnsnames.ora to point to the database the connection info.

  • Problem to establish connection between Oracle SQL and JDBC

    Hi friends i have been trying this code from two days i donno whats wrong please try to sort the problem thank u in advance this is my program:
    //This is my Connection class
    package com.java.jdbc.util;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class EmployeeUtil {
    public EmployeeUtil()
    public static Connection getconnection()
    Connection con=null;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    //DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORANT","system","manager");
    // Class.forName("sun.jdbc.odbc.OracleDriver").newInstance();
    // con = DriverManager.getConnection("jdbc:odbc:Javatut","System","manager");
    } catch (ClassNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } catch (InstantiationException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } catch (IllegalAccessException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    return con;
    //This is my DB class:
    package com.java.jdbc.DB;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import com.java.jdbc.info.EmployeeInfo;
    import com.java.jdbc.util.EmployeeUtil;
    public class EmployeeDB {
    Connection connection=null;
    public EmployeeDB()
    //this.connection=EmployeeUtil.getconnection();
    public void select(EmployeeInfo empinfo)
    this.connection=EmployeeUtil.getconnection();
    String stb = "select * from employee";
    try {
    Statement stmt = connection.createStatement();
    ResultSet rs = stmt.executeQuery(stb);
    System.out.println(rs);
    //EmployeeInfo empinfo = new EmployeeInfo();
    while(rs.next())
    empinfo.setEmpId(rs.getString(1));
    empinfo.setEmpfName(rs.getString(2));
    empinfo.setEmplName(rs.getString(3));
    empinfo.setEmpAge(rs.getString(4));
    empinfo.setEmpSalary(rs.getString(5));
    System.out.println("The EmployeeID is : "+empinfo.getEmpfName());
    System.out.println("The Employee First Name is : "+empinfo.getEmpfName());
    System.out.println("The Employee Last Name is : "+empinfo.getEmplName());
    System.out.println("The Employee Age is : "+empinfo.getEmpAge());
    System.out.println("The Employee Salary is : "+empinfo.getEmpSalary());
    connection.commit();
    } catch (SQLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    //This is my info object
    package com.java.jdbc.info;
    public class EmployeeInfo {
    private String empId;
    private String empfName;
    private String emplName;
    private String empAge;
    private String empSalary;
    public String getEmpAge() {
    return empAge;
    public void setEmpAge(String empAge) {
    this.empAge = empAge;
    public String getEmpfName() {
    return empfName;
    public void setEmpfName(String empfName) {
    this.empfName = empfName;
    public String getEmpId() {
    return empId;
    public void setEmpId(String empId) {
    this.empId = empId;
    public String getEmplName() {
    return emplName;
    public void setEmplName(String emplName) {
    this.emplName = emplName;
    public String getEmpSalary() {
    return empSalary;
    public void setEmpSalary(String empSalary) {
    this.empSalary = empSalary;
    //This is my Controller class:
    package com.java.jdbc.controller;
    import com.java.jdbc.DB.EmployeeDB;
    import com.java.jdbc.info.EmployeeInfo;
    public class EmployeeController {
    public static void main(String args[])
    EmployeeDB empdb = new EmployeeDB();
    EmployeeInfo emp = new EmployeeInfo();
    empdb.select(emp);
    // I got these errors:
    java.sql.SQLException: Io exception: Got minus one from a read call
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:210)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:251)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at com.java.jdbc.util.EmployeeUtil.getconnection(EmployeeUtil.java:18)
    at com.java.jdbc.DB.EmployeeDB.select(EmployeeDB.java:20)
    at com.java.jdbc.controller.EmployeeController.main(EmployeeController.java:11)
    Exception in thread "main" java.lang.NullPointerException
    at com.java.jdbc.DB.EmployeeDB.select(EmployeeDB.java:23)
    at com.java.jdbc.controller.EmployeeController.main(EmployeeController.java:11)

    Are you using Oracle 10.2 in shared server configuration under Windows?
    If so it's a driver bug (BUG - Connection pooling with 10g 10.1.3 Preview 4 App Server Oracle suggest to use OCI driver.

  • Can not establish connection Oracle DB

    Hi PI Gurus,
    We have a sender JDBC CC, its working absolutely fine in PI dev.
    when I check this CC in PI Qality it is giving me error as:
    Error during database connection to the database URL 'jdbc:oracle:thin:@204.145.15.141:1521:PERM' using the JDBC driver 'oracle.jdbc.driver.Oracledriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Can not establish connection:: SAPClassNotFoundException: oracle.jdbc.driver.Oracledriver'
    It clearly says that driver is not installed, thats why connection is not getting established. Our BASIS team installed the drivers twice copied from Dev systems, still the same error is coming.
    Can anyone throw some light on this, is any problem with the version?
    Thanks,
    Krishna

    Hi Krishna,
    Can you check two things:
    1. whether the host name of the jdbc server u are tryin to access is present in the PI Quality system hosts file
    2. Whether connectivity port is correctly opened with the jdbc server, i.e connectivity exists and is tested.
    Regards,
    Souvik

  • OFA Connectivity with Oracle Express Server

    Hi All,
    I have installed and Configure Oracle Express Server 6.3.4, it is running fine, I am able to view the dimensions and members, but I am not able to connect it with Oracle Financial Analyzer. Please inform me how to establish connection between Oracle Express Server and Oracle Financial Analyzer.

    but I am not able to connect it with Oracle Financial Analyzer. What is the error?
    Please inform me how to establish connection between Oracle Express Server and Oracle Financial Analyzer.Please see these docs.
    Oracle Financial Analyzer Top Issues (v6.x) [ID 227199.1]
    Oracle Financial Analyzer 6.x Frequently Asked Questions (FAQ's) [ID 203229.1]
    Oracle Financial Analyzer Technical Notes Index [ID 132065.1]
    There are No Financial Analyzer User Names Associated With the Given User ID [ID 237317.1]
    Thanks,
    Hussein

  • Slow connection through Oracle ODBC

    Hello,
    I have problems with connecting to ORACLE fr om IIS (Win2000) using Oracle's ODBC driver.
    I am using Oracle 8.1.7 SE. I tried to change connection pooling timeout of the ODBC driver, but still connections time out after a minute or so and it takes 6-8 seconds to load a simple web page that reads only ~ 1 kb of information from ORACLE. The time to establish a connection to MS (Access ,SQL server) is less than a second. How can I establish connections to ORACLE faster?
    Please help,
    thanks,
    Gyorgy

    Justin,
    thanks for your quick replies.
    Using Oracle ODBC 32Bit Test:
    the connection seems instantaneous. I tried to enable connection pooling for Oracle ODBC driver with a wait in the pool for 600s. Maybe this will keep it live and I can instantiate a fake connection every 10 minutes? I do not what else I could try ...
    Gyorgy
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Justin Cave ([email protected]):
    Can you try connecting via ODBCTest or via the 'Test Connection' button in the DSN creation dialog box, to see how long that takes? Your tnspings are certainly reasonable.
    I'm curious as to whether you see a difference between connecting via a DSN or through a DSN-less connection string.
    Justin<HR></BLOCKQUOTE>
    null

  • Establish SSL connection to Oracle Instance w/JDBC Thin Client

    Hello all,
    I am writing a monitoring utility that will allow me to establish connections to both Oracle instances and LDAP repositories and query them to determine that they are up and running. My utility consists of a number of objects that handle connections to the LDAP and Oracle instances. I need to be able to do SSL and non-SSL connections to said instances.
    My issue is this: I am able to do SSL and non-SSL to LDAP, and non-SSL to an Oracle instance. I am having problems, though, establishing an SSL connection to an Oracle instance (I am using the thin client). Whenever I try, a SQLException is thrown that states: "Encountered a problem with the secret store. Check the wallet location for the presense of an <b>open</b> wallet (cwallet.sso) and ensure that the wallet contains the correct credentials..."
    Ok, a little background for those who may need it. Oracle uses a wallet to hold certs that allow SSL connections. I have a wallet on my box, and, from the command line, I am able to sqlplus into and tnsping the appropriate Oracle instances, so I know it is setup properly. The inability to connect only occurs in my code. My code looks like this:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Security.addProvider(new oracle.security.pki.OraclePKIProvider());
    /*Setup connection properties*/
    String connectionString = "testbox01:1000:ssl_instances_name";
    String userName = "userName";
    String pwd = "password";
    Properties props = new Properties();
    props.put("oracle.net.ssl_version", 3.0");
    props.put("oracle.net.wallet_location", "SOURCE=(METHOD=file)(METHOD_DATA=(DIRECTORY=c:\\wallet)))");
    props.put("oracle.net.ssl_cipher_suites", "ssl cipher suites");
    props.put("oracle.net.ssl_server_dn_match", "FALSE");
    props.put("oracle.net.ssl_client_authentication", "true");
    /*Do connection and return connection object
    OracleDataSource ods = new OracleDataSource();
    ods.setUser(userName);
    ods.setPassword(pwd);
    ods.setUrl("jdbc:oracle:thin:@" + connectionString);
    ods.setConnectionProperties(props);
    Connection conn = ods.getConnection(); <---This is where code errors out with SQLException described above.
    return conn;
    And that's pretty much it. Anyone have any ideas?

    Ok, that looked horrible. Let's try this again:<br>
    <br>
    I am writing a monitoring utility that will allow me to establish connections to both Oracle instances and LDAP repositories and query them to determine that they are up and running. My utility consists of a number of objects that handle connections to the LDAP and Oracle instances. I need to be able to do SSL and non-SSL connections to said instances.<br>
    <br>
    My issue is this: I am able to do SSL and non-SSL to LDAP, and non-SSL to an Oracle instance. I am having problems, though, establishing an SSL connection to an Oracle instance. Whenever I try, a SQLException is thrown that states: "Encountered a problem with the secret store. Check the wallet location for the presense of an <b>open</b> wallet (cwallet.sso) and ensure that the wallet contains the correct credentials..."<br>
    <br>
    Ok, a little background for those who may need it. Oracle uses a wallet to hold certs that allow SSL connections. I have a wallet on my box, and, from the command line, I am able to sqlplus into and tnsping the appropriate Oracle instances, so I know it is setup properly. The inability to connect only occurs in my code. My code looks like this:<br>
    <br>
    *****<br>
    <br>
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());<br>
    Security.addProvider(new oracle.security.pki.OraclePKIProvider());<br>
    <br>
    /*Setup connection properties*/<br>
    <br>
    String connectionString = "testbox01:1000:ssl_instances_name";<br>
    String userName = "userName";<br>
    String pwd = "password";<br>
    <br>
    Properties props = new Properties();<br>
    props.put("oracle.net.ssl_version", 3.0");<br>
    props.put("oracle.net.wallet_location", "SOURCE=(METHOD=file)(METHOD_DATA=(DIRECTORY=c:\\wallet)))");<br>
    props.put("oracle.net.ssl_cipher_suites", "ssl cipher suites");<br>
    props.put("oracle.net.ssl_server_dn_match", "FALSE");<br>
    props.put("oracle.net.ssl_client_authentication", "true");<br>
    <br>
    /*Do connection and return connection object*/<br>
    OracleDataSource ods = new OracleDataSource();<br>
    ods.setUser(userName);<br>
    ods.setPassword(pwd);<br>
    ods.setUrl("jdbc:oracle:thin:@" + connectionString);<br>
    ods.setConnectionProperties(props);<br>
    <br>
    Connection conn = ods.getConnection(); <---This is where code errors out with SQLException described above.<br>
    <br>
    return conn;<br>
    <br>
    *****<br>
    <br>
    And that's pretty much it. Anyone have any ideas?<br>

  • 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/

  • Can we establish connection between developer 6i with oracle 10g

    hi all
    can some body guide me that how we establish connection between developer 6i with oracle 10g. i have install developer and oracle 10g on different machine
    please guide me

    Look at following thread
    Re: Patch 18 available for Windows Client/Server Forms 6i
    I had installed Patch 18 against 10G DB and Forms work well.
    Anyway you can see patches in
    http://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=4948577&release=3060000&plat_lang=912P
    Hope this helps
    Regards
    Rosario

  • IO Error: The Network Adapter could not establish the connection in oracle

    Hi experts,
    I have oracle developer days installed in my vitrual box machine. The connection to oracle datatase (11.2.0.2) contained in the oracle developer days was working fine via sql developer. I use eclipse to write some java programs to connect the database. However, somehow, I cannot connect the database via sql deveoper anymore. This is the error I got when I tried to connect it via basic connection type:
    Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection
    Can anybody shed a light on this issue please. Thanks a lot in advance.

    user571093 wrote:
    Hi experts,
    I have oracle developer days installed in my vitrual box machine. The connection to oracle datatase (11.2.0.2) contained in the oracle developer days was working fine via sql developer. I use eclipse to write some java programs to connect the database. However, somehow, I cannot connect the database via sql deveoper anymore. This is the error I got when I tried to connect it via basic connection type:
    Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection
    Can anybody shed a light on this issue please. Thanks a lot in advance.Do you realize & understand that we are NOT standing behind you?
    I, too, am running Oracle Developer Days inside VirtualBox.
    On which system is SQL Developer installed?
    The post errors indicate an OS/networking issue.
    when was last time all worked without error?
    what changed since then?
    How do I ask a question on the forums?
    SQL and PL/SQL FAQ

  • Trying to simply connect to Oracle with VBscript/ASP - and I cannot.

    This is rather embarrassing. I am pretty fluent with ASP and VBscript, and I have written many a web application connecting to Microsoft SQL Server. Now I have a need to connect to an Oracle database, and I'm beating my head against the wall.
    1) Web server is Windows Server 2003 SP1
    2) Using ASP (not ASP.NET) & VBscript
    3) I have installed the Oracle drivers on the server - it is version 10g
    4) The administrator of the Oracle database to which I want to connect has created a username and password for me to use from within my code
    5) Here is the code I am trying to run:
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "Provider=MSDAORA;Data Source=XXXXXXX;User Id=YYYYYYY;Password=ZZZZZZZ;"
    That's it. 2 lines of code just trying to establish a connection. Using the user name and password provided to me by the administrator, and for Data Source I am using the IP address of the Oracle server (like I have done in the past when connecting to SQL Server). I receive the following error message when viewing this in a browser:
    Microsoft OLE DB Provider for Oracle error '80004005'
    ORA-12154: TNS:could not resolve the connect identifier specified
    Evidently, the Data Source I am using is not correct, but I was provided no other information from the admin. This is the first time any of us have tried to connect to Oracle using ASP/VBScript, so the administrator isn't sure what I need to do ... any help would be so appreciated.

    Hello,
    I got mine to work by setting up an ODBC System DSN and connecting to it. I think this bypasses the Microsoft driver, which might be what's causing the problem.
    Set Db = Server.CreateObject("ADODB.Connection")
    Db.Open "DSN=TEST;User ID=userid;Password=password;"
    Good luck, I've found it requires a lot of persistence...
    Al
    Springfield, MO

  • Unable to connect to Oracle database running on Windows machine from linux.

    Hi,
    I'm not able to connect to oracle database running on Windows machine from Linux machine. I'm geting the below mentioned error. I have given below the code I used to connect to database and database propertes.Do I need to use any specific driver?
    Please help me.
    Thanks,
    Sunjyoti
    Code :
    import oracle.jdbc.pool.OracleDataSource;
    import java.sql.Connection;
    import java.util.*;
    import java.sql.*;
    import java.io.*;
    class try2{
    public static void main(String args[]) {
    try {
              System.out.println("hi");
    // Load the properties file to get the connection information
    Properties prop = new Properties();
    prop.load(new FileInputStream("/home/sreejith/EDIReader/Connection.properties"));
    // Create a OracleDataSource instance
    OracleDataSource ods = new OracleDataSource();
    System.out.println("prop is "+prop);
    configureDataSource(ods, prop);
    Connection conn=null;
    // Create a connection object
    conn = ods.getConnection();
         System.out.println("Connection is"+conn);
    // Sets the auto-commit property for the connection to be false.
    conn.setAutoCommit(false);
    } catch (SQLException sqlEx){ // Handle SQL Errors
    System.out.println("In exception "+sqlEx);
    } catch(Exception excep) { // Handle other errors
    System.out.println(" Exception "+ excep.toString());
    private static void configureDataSource(OracleDataSource ods, Properties prop) {
    // Database Host Name
    ods.setServerName(prop.getProperty("HostName"));
    // Set the database SID
    ods.setDatabaseName(prop.getProperty("SID"));
    // Set database port
    ods.setPortNumber( new Integer( prop.getProperty("Port") ).intValue());
    // Set the driver type
    ods.setDriverType ("thin");
    // Sets the user name
    ods.setUser(prop.getProperty("UserName"));
    // Sets the password
    ods.setPassword(prop.getProperty("Password"));
    Connection properties :
    # Your Database Connection details
    HostName = 10.20.3.19
    SID = EDIREAD
    Port = 1521
    UserName = dbuser
    Password = dbuser
    Error I'm getting is
    error while trying to connect with odbc datasource
    [root@iflexpau2217 EDIReader]# java try2
    hi
    prop is {HostName=10.20.3.19, Password=dbuser, UserName=dbuser, SID=EDIREAD, Port=1521}
    In exception java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
    Also I tried to connect with weblogic JDBC driver
    Code is here:
    import java.io.BufferedReader;
    import java.io.ByteArrayInputStream;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    //import com.entrust.toolkit.util.ByteArray;
    public class trial{
         public static void main(String args[]) throws IOException{
              System.out.println("hi");
              Connection p_conn = null;
              PreparedStatement xml_insert = null;
              try {
         // Load the JDBC driver
                   System.out.println("hi2");
         // String driverName = "oracle.jdbc.driver.OracleDriver";
    String driverName = "weblogic.jdbc.oracle.OracleDriver";
         System.out.println("hi2");
         Class.forName(driverName);
         // Create a connection to the database
         String serverName = "10.20.3.19";
         String portNumber = "1521";
         String sid = "EDIREAD";
         //String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
    String url = "jdbc:bea:oracle://10.20.3.19:1521";
         String username = "dbuser";
         String password = "dbuser";
    System.out.println("connection is:"+p_conn+"user name is"+username+"password is"+password);
         p_conn = DriverManager.getConnection(url, username, password);
         System.out.println("connection is:"+p_conn+"user name is"+username+"password is"+password);
              xml_insert=p_conn.prepareStatement("insert into PRTB_SUBUNIT (SUBUNT_ID,SUBUNT_SUB_UNIT,SUBUNT_PHYUNT_ID) values (?,?,?)");
              //InputStream in=null;
              File l_file=new File("/home/sreejith/EDIReader/propertyfiles/inputfile/BUG_10802_ES_CSB19_68.txt");
              BufferedReader input =null;
              input=new BufferedReader(new FileReader(l_file));
              String line = null;
              StringBuffer trial=new StringBuffer();
              while (( line = input.readLine()) != null){
                   trial.append(line);
                   trial.append(System.getProperty("line.separator"));
              //InputStream is = new BufferedInputStream(new FileInputStream(l_file));
              System.out.println(trial.toString());
              //Blob b ;
              //byte[] bytes=trial.toString().getBytes();
              //System.out.println("Size-->"+bytes.length);
              xml_insert.setString(1,new String("SpecailChar"));
              //xml_insert.setBinaryStream(2,new ByteArrayInputStream(bytes),15920);
              xml_insert.setString(3,"SpecailChar");
              xml_insert.executeUpdate();
              p_conn.commit();
              } catch (ClassNotFoundException e) {
                   System.out.println("ClassNotFoundException:"+e.getMessage());
              // Could not find the database driver
              } catch (SQLException e) {
                   System.out.println("SQEXCEPTIN:"+e.getMessage());
              // Could not connect to the database
              }catch (FileNotFoundException e) {
                   System.out.println("filenot found:"+e.getMessage());
              // Could not connect to the database
    Error I'm getting is
    error while trying with jdbc:
    SQEXCEPTIN:[BEA][Oracle JDBC Driver]Error establishing socket to host and port: 10.20.3.19:1521. Reason: Connection refused

    Is the Windows firewall active? Have you enabled the port on the firewall, if it is?

  • JDBC connection to Oracle 10g RAC periodically times out

    I've been banging my head against the wall for months now and can't figure out why this is and what's causing it.
    We have 6x CF8 servers in our environment. 3 of which work perfectly and the other 3 have the following problem. All 6 machines were installed at the same time and followed the exact same installation plan.
    When I configure Oracle RAC data source, some of the machines time-out connecting to Oracle from time-to-time.
    Config:
    Solaris 9 on both CF and Oracle
    CF8 Enterprise with the latest updater.
    Apache 2 (not that it's relevant)
    6 machines, load-balanced (not clustered), identical install and configuration.
    data source config:
    JDBC URL: jdbc:macromedia:oracle://10.0.0.3:1521;serviceName=dbname.ourdomain.com;AlternateServers= (10.0.0.4:1521);LoadBalancing=true
    DRIVER CLASS: macromedia.jdbc.MacromediaDriver
    The problem:
    Every few minutes, CF starts hanging requests that deal with a specific RAC only data source. After about 30 seconds, all requests bail and generate this error in cfserver.log:
    A non-SQL error occurred while requesting a connection from dbsource.
    Timed out trying to establish connection
    This happens with any RAC data source on the "bad" servers while the "good" servers don't have this problem. The "bad" server doesn't have any problems with direct (non-rac) Oracle data source.
    Already tried:
    Moving server connections around on a switch (rulling out bad switch port)
    Copying driver from the healthy server (but it's the same installer anyway)
    Changed from RAC to normal Oracle type data source - works perfectly. So at the moment I have 3 servers connecting to a specific oracle instance and the other 3 connecting to RAC.
    Tried googling and searching forums and even Oracle metalink - nothing I could see relevant to this.
    It's a shame that after spending a ton of money on CF8 upgrades and Oracle RAC, we can't really utilize fail-over on the database connection.
    Any takers?
    Thanks,
    Henry

    I have the following in my CLASSPATH:
    C:\Ora10g1\product\10.2.0\db_1\jdbc\lib\jdbc.jar;
    C:\Ora10g1\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar;
    C:\Ora10g1\product\10.2.0\db_1\jlib\jndi.jar;
    C:\Ora10g1\product\10.2.0\db_1\jlib\orai18n.jar;
    Still 'Cannot find type 'oracle.jdbc.pool.OracleDataSource'
    Thanks

Maybe you are looking for

  • How to make items in a list word wrap as needed and be variable heights

    I am trying to build a custom itemrenderer for the List control.  The items in the list are variable lengths of text, some of the text items will have different colors determined at runtime base on some criteria (this works fine now with my custom it

  • Local Logical System

    Hi All, This is my first post. when I'm trying to create a business partner., there was an error message saying " Local Logical System is not defined / assigned ".  What is that exactly mean by? and What are the prior steps we need to take before cre

  • Changing a local account to a mobile account

    Hello everyone. I have a local account on this computer and I want to test some sync settings. How can I make this local account a mobile account? I already have a mobile account that will create a new local account on new computers, but I want the l

  • I am unable to have my password reset on acrobat on my mini  iPad HD

    Is there upgrade, or guide, manual for instructions?

  • Enhancement Point Creation

    Can we create our own enhance point in standard program ie I want to create a point where i need to change & implement the new logic at that point.plz suggest