Could not connect to a DATABASE with localhost as Hostname from SQL develop

I am not able to connect to any Database from SQL Developer by providing "localhost" as Hostname. I could able to connect by providing the IP(192.168.1.50) of the system.
The problem here is If I am out of internet, My system does not have IP, So I am not able to connect to DB
But I need to submit a project wheere I will not have any internet. Could you please let me know how to connect to DB using localhost
Following are the listener.ora and tnsnames.ora files.
listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.50)(PORT = 1521))
=============================
tnsnames.ora
# tnsnames.ora Network Configuration File: D:\oracle\product\10.2.0\db_2\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORA9 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.50)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora9)
ORA8 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.50)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ora8)
EMP =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.50)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = emp)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.50)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
Thanks in advance,
Srini

Oracle always uses DNS.
DNS consults the local host file.
Try in a command box
ping localhost
This should work.
If this doesn't work you need to edit
%WINDOWS%\'systems\drivers\etc\hosts
The first line needs to read
127.0.0.1 localhost
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • Could not connect to remote service [rmi://localhost:1099/

    I have a large deployment with two filr appliances and one database and one search index.
    I am running zen load balancer in front of the appliance which works great.
    There are no config changes to the filr appliances in terms of port redirection.
    I had an issue upgrading from 1.0.1 to 1.1 so I blew it away and started fresh.
    After I installed and configured the appliances there were no issues . Now the :9443 configuration section will not work I get
    (this is just the top lines)
    HTTP ERROR 500
    Problem accessing /. Reason:
    Could not connect to remote service [rmi://localhost:1099/GangliaService]; nested exception is java.rmi.NoSuchObjectException: no such object in table
    Caused by:
    org.springframework.remoting.RemoteConnectFailureE xception: Could not connect to remote service [rmi://localhost:1099/GangliaService]; nested exception is java.rmi.NoSuchObjectException: no such object in table
    at org.springframework.remoting.rmi.RmiClientIntercep torUtils.convertRmiAccessException(RmiClientInterc eptorUtils.java:190)
    at org.springframework.remoting.rmi.RmiClientIntercep tor.doInvoke(RmiClientInterceptor.java:347)
    This is on all appliances (search,data,filr1,filr2)
    I restarted filr2 and the admin section 9443 comes back for a short time. Maybe 10 minutes then I get the same error. But now after the restart I get and authentication box asking for credentials on 8443. when I put in the admin or other creds it directs me to a page that says
    HTTP Status 500 - Filter execution threw an exception
    type Exception report
    message Filter execution threw an exception
    description The server encountered an internal error that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Filter execution threw an exception
    org.kablink.teaming.webdav.servlet.filter.Resource DispatchFilter.doFilter(ResourceDispatchFilter.jav a:87)
    root cause
    java.lang.ExceptionInInitializerError
    java.lang.J9VMInternals.initialize(J9VMInternals.j ava:259)
    org.kablink.teaming.asmodule.spring.security.userd etails.DecryptedPasswordUserDetailsService.loadUse rByUsername(DecryptedPasswordUserDetailsService.ja va:51)
    org.springframework.security.web.authentication.http://www.DigestAuthenticationFilte...lter.java:144)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 323)
    org.springframework.security.web.context.SecurityC ontextPersistenceFilter.doFilter(SecurityContextPe rsistenceFilter.java:87)
    org.springframework.security.web.FilterChainProxy$ VirtualFilterChain.doFilter(FilterChainProxy.java: 323)
    org.springframework.security.web.FilterChainProxy. doFilter(FilterChainProxy.java:173)
    org.springframework.web.filter.DelegatingFilterPro xy.invokeDelegate(DelegatingFilterProxy.java:346)
    org.springframework.web.filter.DelegatingFilterPro xy.doFilter(DelegatingFilterProxy.java:259)
    org.kablink.teaming.webdav.servlet.filter.Resource DispatchFilter.doFilter(ResourceDispatchFilter.jav a:87)
    I have rebooted to no avail. If I restart the jetty service I do get the appliance login for 9443 but if I try to login I get the same message about [rmi://localhost:1099/
    again if I reboot then 9443 works for 10 mins but 8443 gets hosed. Everything worked fine until I rebooted the appliance.
    I am afraid to even reboot these appliances now in fear that the will cease to work.
    I should also note that this was part of the upgrade issue I had after I rebooted all of the appliances.
    Thanks in advance.

    Originally Posted by bschilliger
    The same issue here:
    HTTP Status 500 - Filter execution threw an exception
    type Exception report
    message Filter execution threw an exception
    description The server encountered an internal error that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Filter execution threw an exception
    org.kablink.teaming.webdav.servlet.filter.Resource DispatchFilter.doFilter(ResourceDispatchFilter.jav a:87)
    The password in the FILR appliance configuration 'Outbound E-Mail' was too complex (with special characaters). After changing the special characters with letters and/or numbers, the server starts without any troubles!
    Regards from Switzerland,
    Beat

  • Could not connect to Oracle database. (HY000): BI Answers Problem

    Hi,
    I am using OBIEE 11g and 11g admin client tool is installed in my machine. I created one rpd and I deploy that rpd in the server through Enterprise manager fusion middleware control. But when try to run the analysis from BI answers it throws and error like
    "TNS:could not resolve the connect identifier specified at OCI call OCIServerAttach. [nQSError: 17014] Could not connect to Oracle database. (HY000)".
    In the rpd I use OCI default (10g/11g) and cheked that connection is successful and also when I click on view data option in the physical layer I am able to see the data. I cheked with DBAs and correct TNS entries are also there in the server. Could not understand where is the problem.
    Please help.
    Thanks
    Titas

    Try like this
    Call Interface: Default (OCI 10g/11g)
    Data source Name->localhost:1521/XE
    BTW: Whats the client bit version 32/64 bit, if you have 64bit and above is not working try with Oracle client 32bit.
    Pls mark correct/helpful if helps

  • Error Could not connect to the database - ora-12545: tns:name lookup failure

    Hi,
    I am a tech at a failing company. Unfortuneatly some users still need ADI installed and working with very limited resources to troubleshoot oracle. I am getting the error - ( Could not connect to the database - ora-12545: tns:name lookup failure )when the user tries to log on to ADI. Any suggestions? I would really appreciate it. We are on Windows NT on an NT network. Oracle 8.05 client installed and ADI 6.0.
    Thanks, Mary

    Copy the tnsname.ora file from Oracle Database serve onto the client PC.
    Path: %Oracle_home%\net80\admin\
    Send me a mail if there is any other issues
    Regards
    Oluseyi Funmi Oduberu
    Oracle Consultant
    Email:[email protected]
    Hi,
    I am a tech at a failing company. Unfortuneatly some users still need ADI installed and working with very limited resources to troubleshoot oracle. I am getting the error - ( Could not connect to the database - ora-12545: tns:name lookup failure )when the user tries to log on to ADI. Any suggestions? I would really appreciate it. We are on Windows NT on an NT network. Oracle 8.05 client installed and ADI 6.0.
    Thanks, Mary

  • Could not signon to the database with user VP1!!

    Hello All,
    people tools : 8.53 - windows 7, my local one
    peoplesoft application: HRMS 9.2 version -- oracle linux OS
    oracle 11g database -- oracle  linux OS
    when i start the app server domain for HSMS application using psadmin, its not starting
    when i look for appserv logs, i got this error
    Password has expired
    could not sign on to database with user vp1
    i can able to login into the database, and able to connect to SYSADM schema also
    so i tried manually updated the password operpswd in sysadm.psoprdefn table as VP1 and updated,. committed.
    and tried to connect to database using datamover to encrypt the password in my local machine, it says tns could not find the id specified
    but i can able to ping to linux database , tnsping is working, and i can able to establish a database session from my local one to linux server.
    Still unable to start the HRMS application domain in linux server
    kindly help.
    Regards.

    oops sorry Nicolas. ITs my typo mistake.
    Its peoplesoft finance application. not the hrms. and user id and password is VP1/VP1 was set during implementation.
    After implementation , we have not used the application for some months. I think that may be the reason for password expire.
    the following are the error:
    File: sql access ManagerSQL error . stmt #: 2 Error Position: 0 Return:28001 - ORA 28001: the password has expired
    SQL Access Manager: File: SQL Access ManagerSQL error. stmt #: 2 Error Position: 0 Return: 2 ORA 28001: the password has expired
    Database Options: override_connection_reset:0
    Database Signon: Could not sign on to database PSFNDEMO with user VP1
    Server failed to start
    End boot attempt on domain PSFNDEMO
    i also performed the steps pointed by Hakan in your blog
    On The Peoplesoft Road: Peoplesoft passwords
    Still no luck.
    kindly suggest
    Thanks.

  • ORA-12154: TNS:Could not connect to Oracle database.

    Hi All,
    I'm getting the following error while trying to access OBIEE dashboard.
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 12154, message: ORA-12154: TNS:could not resolve the connect identifier specified at OCI call OCIServerAttach. [nQSError: 17014] Could not connect to Oracle database. (HY000)
    I have oracle 10g R2, I can connect my database using SQLPLUS. I am not able to do Update Row Count from Admin tool also. If anyone come across this issue, please share your experience. Anyhelp would be appreciated.
    Thanks,
    Ravi

    The problem is OBIEE server not able to read the tnsnames.ora file. That depends upon the what you set as ORACLE_HOME. that can be find with tnsping command at command line. Follow this article about setting up oracle home and oci drivers
    http://oraclebizint.wordpress.com/2007/10/03/oracle-bi-ee-101332-identifying-oracle-homes-for-oci-drivers/
    please make sure that your DB-home is the first entry in your PATH environment variable.
    Have you created TNS_ADMIN environment variable. Create a environment variable TNS_ADMIN which maps to location where tnsnames.ora file located.
    let me know if you are not able to load after this steps.
    - Madan

  • Could not connect to the database

    I have installed Oracle 11.5.10.2 and ADI 7.1.3.10.5
    I can logon to oracle 11i but I cannot logon to ADI using the same username and password of oracle 11i.
    In the ADI define databases form I have the following:
    GWYUID: applsyspub/pub
    FNDNAM: apps
    NCA Connection: (blank)
    Server ID: (blank)
    I receive the following message:
    ''Could not connect to the database. Invalid Username or Password''
    I can use tnsping and tnsping80 successfully from the client.
    Any help would be appreciated
    Thank you.

    Starting from 11.5.10 and above, you have to provide the 'Server ID'. Change the current value of 'Server ID' to match APPL_SERVER_ID value found in your dbc file.
    Find the dbc file under:
    $FND_TOP/secure directory
    The Server ID field is one of the parameters used in setting up the database definition in ADI.

  • Could not connect to Oracle database from excel macro. Getting connection not open.

    Hi all, 
    I could not connect to oracle database using excel macro. After much R&D also, I cannot find right solution. Please help me where I am doing wrong.
    Sub Button2_Click()
    Dim Conn As New ADODB.Connection
    Dim RS As New ADODB.Recordset
    Dim Cmd As New ADODB.Command
    Dim sqlText As String
    Dim Row As Long
    Dim Findex As Long
    Dim Data As Worksheet
    Dim X As Long
    Dim UID As String
    Dim PWD As String
    Dim Server As String
    Dim strCon As String
    Application.Calculation = xlCalculationManual
    UID = "myUserid" 'Enter the User ID
    PWD = "myPassword" 'Enter the password
    Server = "myHostname or myServername" 
    Set Data = Sheets("Sheet2")  
    Data.Select
    Range("A:J").ClearContents 
    strCon1 = "Provider = Microsoft.ACE.OLEDB.12.0;DATA SOURCE=myHostName;Database=myDBname;uid=myUserid;pwd=myPassword;"
    Conn.Open (strCon1)
    Cmd.ActiveConnection = Conn
    Cmd.CommandType = adCmdText
    ' Put your query next
    sqlText = " select * from table "
    Cmd.CommandText = sqlText
    Set RS = Cmd.Execute
    For X = 0 To 17 
    Data.Cells(1, X + 1) = RS.Fields(X).Name
    Next
    Do While Not RS.EOF 'this loops through the data and puts it in the spreadsheet
    Row = Row + 1
    For Findex = 0 To RS.Fields.Count - 1
    Data.Cells(Row + 1, Findex + 1) = RS.Fields(Findex).Value
    Next Findex
    RS.MoveNext
    Loop
    Application.Calculation = xlCalculationAutomatic
    Application.Calculate
    End Sub
    sammy

    I have set oci.dll in to the path specified. Prior to this I musy say that, I have 64 bit excel 2010 & installed respective drivers from the link provided http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html
    But
    still I am facing as:-" Provider cannot be found. It may not be properly installed."
    sammy

  • Could not connect to the internet with my iPod Touch 4th Gen

    I set up an wireless ad-hoc network with my windows vista computer with WPA-2 Personal security type, however, while trying to connect it from the iTouch, it keep saying incorrect password.
    When I tried setting up another wireless ad-hoc network with WEP security type, and shared the internet through it, I can input my password successfully on the iTouch and get connect to the network, however, when I trying loading a page on Safari, it does not load, and say it is not connected to the internet. Please Help.

    Does the iPod connect to other networks?
    Do other devices now connect? ( I thin yo are say no. In that case you have a router problem.  Try powering off and then back on the router. Next try changing the security on the router. Test it with no security. The reset ther router. Last, get a new router.)
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Power off and then back on the router
    - Reset network settings: Settings>General>Reset>Reset Network Settings
    - iOS: Troubleshooting Wi-Fi networks and connections
    - iOS: Recommended settings for Wi-Fi routers and access points
    - Restore from backup. See:
    iOS: How to back up
    - Restore to factory settings/new iOS device.
    - Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • I just bought a used and restored 3G iTouch. I've never had an iPod before. When I turn it on it goes to the picture of a usb connecting to iTunes. When I connect to iTunes it says 'could not connect because its locked with a passcode'. Help?

    Is it screwed or is there something I can do to fix it?

    Plae the iPod in Recovery mode and then connect to your computer and restore via iTunes.

  • Tns error could not connect to database but can tnsping and sqlplus

    The new install OBIEE 10.1.3.4.1, with two Linux RH/64 Bit servers set up and running, but can't get to 11g database when running reports.
    Error: nqsError 17001 Oracle Error Code 12154, message ORA-12154: TNS could not resolve the connect identifier specified at OCI call OCIServerAttach. nQSError 17014 could not connect to Oracle database
    Server 1 BI Server
    BI server is running.
    oc4j is running.
    jdk is installed
    /setup/user.sh variables and libs set
    .bash_profile variables and libs set
    oracle client installed with lib32
    can tnsping the database from here using SID
    can sqplus login to the database from here
    changed connection pool offiline and uploaded new .rpd
    this script does not work /setup . sa-cli.sh to test client, nothing happens, also unable to connect to BI Server in online mode from Windows client 32bit.
    Server 2 Presentation Server
    saw server is running
    set odbc AnalyticsWeb DSN to point to BI Server 1
    Since I can ping and connect with tns, why is presentation server throwing errors?
    Thanks for the help

    Copy the tnsname.ora file from Oracle Database serve onto the client PC.
    Path: %Oracle_home%\net80\admin\
    Send me a mail if there is any other issues
    Regards
    Oluseyi Funmi Oduberu
    Oracle Consultant
    Email:[email protected]
    Hi,
    I am a tech at a failing company. Unfortuneatly some users still need ADI installed and working with very limited resources to troubleshoot oracle. I am getting the error - ( Could not connect to the database - ora-12545: tns:name lookup failure )when the user tries to log on to ADI. Any suggestions? I would really appreciate it. We are on Windows NT on an NT network. Oracle 8.05 client installed and ADI 6.0.
    Thanks, Mary

  • Server admin could not connect to localhost

    Hi,
    the Problem I have is that I could not connect to the server at localhost. Server admin shows connection error.
    Maybe it is a problem with my certificate state. I have deleted the default one and have to recertificate my own one.
    Any ideas?

    Others have posted in the past that the SA or WGM has 'issues' when the default cert is blown away.
    Have you considered doing a clean install on another volume, then move the default from that install back into your current one? Just an idea before I've had my first coffee.

  • Error "could not connect....0xE8000001  UGH!

    Hey gang. Please help.
    Advanced user here, been reading posts and all Mac Docs for a week straight now. Here is my specific issue
    I can reinstall iTunes and connect to iPod touch just fine. I can unplug ipod a few times, reconnect and iTunes still recognizes it.
    As soon as I eject for the 3rd or 4th time OR restart iTunes, I get the message that it could not connect because of an unkown error 0xE8000001.
    Then I have to reinstall itunes again. it works for 3 or 4 cycles, then bam, same error comes back.
    So I can fix the error and connect, but how can I get rid of it for good? I have done every suggestion and proceedure from Apple written on this site:
    1. reinstall itunes
    2. restart apple device service
    3. clean up install files
    4. repair registry
    5. delete temp files folder
    6. tried every mother board USB 2.0 ports
    7. disabled all "start up services" with msconfig
    8. Restored ipod twice
    9. plus all other printed help here discussed over the past 4 months.
    Nothing works ALL the time. I can just get it to resync 3 times then it comes back????
    Thanks!
    Z

    Copy the tnsname.ora file from Oracle Database serve onto the client PC.
    Path: %Oracle_home%\net80\admin\
    Send me a mail if there is any other issues
    Regards
    Oluseyi Funmi Oduberu
    Oracle Consultant
    Email:[email protected]
    Hi,
    I am a tech at a failing company. Unfortuneatly some users still need ADI installed and working with very limited resources to troubleshoot oracle. I am getting the error - ( Could not connect to the database - ora-12545: tns:name lookup failure )when the user tries to log on to ADI. Any suggestions? I would really appreciate it. We are on Windows NT on an NT network. Oracle 8.05 client installed and ADI 6.0.
    Thanks, Mary

  • OBIEE 11g not connect the Oracle database

    Hi All,
    We installed 11.1.1.6.0 version on Linux 64 bit it works fine after some reason we delete that one and re install on same Linux box,we place old catalog and rpd.
    But when you login all reports is showing errors bellow
    In log file..........
    [nQSError: 43119] Query Failed:
    [2013-10-19T19:47:24.000+00:00] [OracleBIServerComponent] [ERROR:1] [] [] [ecid: 24cef0e6e960bda3:-7f74eefb:141d239504e:-8000-0000000000000d97] [tid: 44b5a940]  [nQSError: 17014] Could not connect to Oracle database. [[
    [nQSError: 17001] Oracle Error code: 12154, message: ORA-12154: TNS:could not resolve the connect identifier specified
    at OCI call OCIServerAttach.
    [nQSError: 43119] Query Failed:
    [nQSError: 43113] Message returned from OBIS.
    In report level
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 17001] Oracle Error code: 12154, message: ORA-12154: TNS:could not resolve the connect identifier specified at OCI call OCIServerAttach. [nQSError: 17014] Could not connect to Oracle database. (HY000)
    Pls help thanks in advance.

    There are 2 places you need to keep TNS names.ora file for OBIEE to connect.
    1. Oracle client which is in your machine
    2. OBIEEhome>Oracle_BI1\network\admin
    I'm sure you would have it in your oracle client. Copy paste the same TNS names in this path too.
    Then open rpd and right click on any table in physical layer and click view data. You should see the results.
    if this doesn't work check your credentials.
    mark if this helps

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

Maybe you are looking for