MSSQL's JDBC random connection refused

I am having a random "unable to connect" error from my java application. Sometimes it's fine, apps running without any problem, but sometimes this exception comes up. I am writing this app at home and my SQL server is at office (behind a router with SPI firewall, but i have port forwarded TCP port 1433 for the connection). If I telnet to SQL server, i wont get any error message but a blank screen, it looks like the server side is waiting for my console input.
IDE: NetBeans IDE 6.0 (Build 200711261600)
JavaSDK: 1.6.0 build 1.6.0_03-b05
MSSQL JDBC Driver: should be latest (i downloaded off from MS website in early March)
MSSQL: MS SQL 2005 Developer Edition
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect
any help would be appreciated
Jimmyson

this is a sample of my JDBC code:
    private boolean isOnline()
        Connection myConnection = null;
        String myServerPath =      "jdbc:sqlserver://" + dbAddress + ":" + dbPort + ";" +
                    "databaseName=" + dbDefaultDB + ";user=" + dbUsername +
                    ";password=" + dbPassword;
        try
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            myConnection = DriverManager.getConnection(myServerPath);
            myConnection.close();
            return true;
        catch (Exception e)
            e.printStackTrace();
            return false;
    }Sorry if my code is bad
Edited by: istudio on Mar 27, 2008 6:23 AM for formatting issue

Similar Messages

  • Random "WSAECONNREFUSED: Connection refused" error

    hello,
    we're connecting to sap using logon groups and randomly we get this error
    <i>TmConnect2: handle = 0
    sncname = []
    set snc-mode OFF TmISncSetOptions: set tm_mode for 0 to TM_SNC_OFF
    disp service:          sapdp00
    TmIGetName: no DISPLAY set
    NiMyHostName: hostname = 'APP006-2'
    terminal name: APP006-2
    connect to dispatcher on host /H/127.0.0.1/S/3201
    RouteString </H/127.0.0.1/S/3201>
    service in route <3201> != servname param <sapdp00>
    NiIGetServNo: servicename '3201' = port 3201
    NiICreateHandle: hdl 3 state NI_INITIAL_CON
    NiIInitSocket: set default settings for new hdl 3/sock 1144 (I4; ST)
    NiIBlockMode: set blockmode for hdl 3 FALSE
    NiITraceByteOrder: CPU byte order: little endian, reverse network, low val .. high val
    Wed Sep 26 16:59:12 2007
    ***LOG Q0I=> NiPConnect2: connect (10061: WSAECONNREFUSED: Connection refused) [nixxi.cpp 2985]
    ERROR => NiPConnect2: SiPeekPendConn failed for hdl 3/sock 1144
        (SI_ECONN_REFUSE/10061; I4; ST; 127.0.0.1:3201) [nixxi.cpp    2985]
    NiICloseHandle: closing initial hdl 3
    ERROR => TmIConnect: NiConnect (rc=-10) [dpxxtm.c     934]
    TM_LAYER TmConnect <<
    TmErrSet: socket invalid (-1)Wed Sep 26 17:00:52 2007
    NiICreateHandle: hdl 4 state NI_INITIAL_CON
    NiIInitSocket: set default settings for new hdl 4/sock 1624 (I4; DG)
    NiDgHdlCreate: state of hdl 4 NI_DG_UNCONNECTED
    NiHsLGetNodeAddr: got hostname 'localhost' from operation system
    NiIGetNodeAddr: hostname 'localhost' = addr 127.0.0.1
    NiDgHdlSendTo: hdl 4 sent 1 of 1 bytes to 127.0.0.1:0
    NiICloseHandle: shutdown and close hdl 4/sock 1624
    NiIExit: free nitab 0C0AF150
    TmThrExit: free local resources
    TmExit: free local resources</i>
    i can't figure why sap gui is trying to connect to 127.0.0.1 ???
    and after a while it works without any modification... very strange no? but annoying!
    if i do not use logon group and connect directly it works but it is not what i need to do.
    any idea?
    regards

    hello,
    thanks but configuration of logon groups is very straightforward...
    my logon group contains my two application servers.
    what else do i have to check?
    regards

  • Connection refused via JDBC

    I have another connection refused problem, seems to be common.
    Looked at previous posts, answer(s) were not explicit.
    Able to connect to db via SQL navigator.
    What do I have to do?
    my code:
    try {
    DriverManager.registerDriver (new
    oracle.jdbc.driver.OracleDriver());
         DriverManager.getConnection      
         ("jdbc:oracle:thin:@192.168.0.3:1521:orcl", "scott", "tig
    er");
         }catch ( SQLException sqle ) {
              out.println( "jdbc error: " + sqle );
    error message:
    jdbc error: java.sql.SQLException: Io exception: Connection
    refused(DESCRIPTION=(TMP=)(VSNNUM=135294976)(ERR=12505)
    (ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
    listener log:
    05-JUL-2001 09:30:32 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=)
    (HOST=__jdbc__)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)
    (HOST=192.168.0.3)(PORT=1407)) * establish * orcl * 12505
    TNS-12505: TNS:listener could not resolve SID given in connect
    descriptor

    Problem solved!
    Helps to look at the tnsnames.ora file. All I had to do was use
    the host name in the URL, because that's the way its spelled out
    in tnsnames.ora

  • JDBC connection refused error ...oracle 8i

    Dearest Java Programmer!
    i am getting an error while using JDBC to connect to oracle8i, my program is simple connection testing using type1 driver .. every thing is perfect as far as the program is concerned, it is compiled successfully.
    but while executing it is raising some exception(error message followed).
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle
    on SQL_HANDLE_ENV failed
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3074)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:3
    23)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at OracleODBCConnection.main(OracleODBCConnection.java:9)
    so please help in rectifying this error.
    thanku

    Dearest Java Programmer!
    i am getting an error while using JDBC to connect to oracle8i, my program is simple connection testing using type1 driver .. every thing is perfect as far as the program is concerned, it is compiled successfully.
    but while executing it is raising some exception(error message followed).
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle
    on SQL_HANDLE_ENV failed
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3074)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:3
    23)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at OracleODBCConnection.main(OracleODBCConnection.java:9)
    so please help in rectifying this error.
    thanku

  • HANA JDBC connection refused

    Hi All,
    Any help with the following would be really appreciated, I have installed the HANA studio and client and have tried to connect to a sandbox environment that our company has, however when I put in the connection details for the server I cannot get the JDBC instance to connect. I get the error shown below.
    I have gone into the administration panel within windows and can create a connection via the ODBC connections using the HDBODBC32 driver with the 300(instanceNo)15 port number and the correct username and password. I get a connection established message.
    I have also tested if I can ping the box and also access the web service  WSDL //gblonhan01:50013/?wsdl, this displays fine. I have asked one of my colleagues to connect to ensure there is nothing at the server side playing up and they can connect fine and carry out operations.
    Basically it sounds to me that I can connect, I can see the box but my JDBC driver is playing up. I have done the u2018turn it off and turn it onu2019 equivalent of a re-install and see that the studio install does put on the JDBC driver as part of the package. No change, I have tried different versions and no success.
    My current install is
    java.version=1.7.0_02
    SAP HANA Studio Version: 1.0.24
    Client version 24 installed as well.
    Its probably something really simple but any help really appreciated before my current very small patch of hair is completely pulled out.
    Error details :
    com.sap.ndb.studio.jdbc.JDBCConnectionStatus: Database connection is not available. See error log for more details.
    at com.sap.ndb.studio.jdbc.JDBCPlugin.createConnection(JDBCPlugin.java:336)
    at com.sap.ndb.studio.navigator.operations.SAPSystemObjectUpdate.executeTryJDBC(SAPSystemObjectUpdate.java:196)
    at com.sap.ndb.studio.navigator.operations.SAPSystemObjectUpdate.execute(SAPSystemObjectUpdate.java:68)
    at com.sap.ndb.studio.navigator.operations.UpdateSAPSystemOperation.execute(UpdateSAPSystemOperation.java:75)
    at com.sap.ndb.studio.datamodel.controler.DataModelOperation.execute(DataModelOperation.java:67)
    at com.sap.ndb.studio.datamodel.controler.DataModelOperationQueue$DataModelOperationThread.run(DataModelOperationQueue.java:99)
    Caused by: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: Cannot connect to jdbc:sap://gblonhan01:30015 [Cannot connect to host gblonhan01:30015 [Permission denied: connect], -813.].
    at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.createException(SQLExceptionSapDB.java:219)
    at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.createException(SQLExceptionSapDB.java:203)
    at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.generateDatabaseException(SQLExceptionSapDB.java:186)
    at com.sap.db.jdbc.Driver.connect(Driver.java:236)
    at com.sap.ndb.studio.jdbc.JDBCPlugin$5.run(JDBCPlugin.java:715)

    Hi,
    What is your HANA Server version. This problem can sometimes occur when you are using are trying to access an older version of server with new HANA studio/client.
    If your DB version is not old, are you able to connect to this server via telnet?
    Regards, Rahul

  • SQL Server 2005 : connection refused

    Hi,
    I have installed SQL Server 2005 (Enterprise trial) on my PC,
    then configured windows Admin Tools/ODBC DataSource.
    I did not give a server name, so it picked up my computer name (OK-6400) as server name.
    Created a DB called ZM there, a few tables, added some data, so it works fine through ODBC (with SqlDbx).
    It never asked for port, so I assume it is 1433, am I wrong?
    Now I need to connect to it through JDBC.
    Tried several times through Eclipse (342) Database Development wizard.
    1) With MSFT JDBC driver tried to use URL: jdbc:sqlserver://localhost:1433;databaseName=OK-6400/ZM
    Tried with or without that server name:
    "The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect"
    2) With JTDS driver URL: jdbc:jtds:sqlserver://localhost:1433/ZM - same connection refused
    or with jdbc:jtds:sqlserver://localhost:1433/ZM;instance=OK-6400 -
    - "java.sql.SQLException: Unable to get information from SQL Server: localhost."
    Am I doing something wrong ? Please help !
    (Haven't used SQL Server before)
    Using Win XP.
    Thank you,
    Oleg.

    TheAvalanche wrote:
    SQL Server 2005 by default has TCP/IP access disabled. If TCP/IP access is enabled it uses a random port number by default I doubt that. Do you have some documentation that says that?
    The following link demonstrates how to change it.
    [http://social.msdn.microsoft.com/forums/en-US/sqlsecurity/thread/249bd1e7-76e2-48f6-a3e0-204a532bee54/]

  • Connection Refused Error while running AS ABAP Initial Load

    All,
    I've never connected SAP NW IdM to an actual SAP system before, and I feel like I'm missing some obvious step of configuration, but I can't figure out what.
    We are in the process of trying provision user accounts to our SAP ABAP systems. My first step was to try to read all of the existing accounts from the ABAP system:
    Our Basis team created me a Communication user with the proper authorizations (I ensured that the authorizations included in SAP_BC_SEC_IDM_COMMUNICATION)
    I created a repository using the SAP NewWeaver AS ABAP (Specific Application Server) Repository Template (No CUA, No SNC) using that user's credentials
    I then used the Job Wizard and used the job template AS ABAP - Initial Load, specifying my repository above.
    When I run the job I get the following:
    Initializing SAP connection with parameters:
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to message server failed Connect_PM MSHOST=<IPADDRESS>, R3NAME=<SID>, GROUP=PUBLIC LOCATION CPIC (TCP/IP) on local host ERROR partner not reached (host <IPADDRESS>, service sapms<SID>) TIME Wed Jun 01 13:54:36 201 RELEASE 640 COMPONENT NI (network interface) VERSION 37 RC -10 MODULE nixxi_r.cpp LINE 8840 DETAIL NiPConnect2 SYSTEM CALL SiPeekPendConn ERRNO 10061 ERRNO TEXT WSAECONNREFUSED: Connection refused COUNTER 1
    Error Init failed
    I'm running SAP NW IdM 7.1 SP5 on Windows Server 2003 with MSSQL 2005. The ABAP server is on a UNIX box with an Oracle 10.2 dB.
    Is there additional configuration that needs to take place on the ABAP side to accept the connection?
    I've tried to find documentation on this, but have been unsuccessful. If someone could point me to the correct documents, or at least point me in the right direction for troubleshooting, it would be greatly appreciated.

    Ankur,
    Looks like the endpoint URL of the webservice is not updated and still pointing to the localhost. Try changing it to http://<ip_addres_of_your_server>:7101..... and see if it works fine then.
    -Arun

  • Connection refused error running JSP on Jdev 10.1.3.0.3.3412 with MySL 5.0

    Hello,
    I'm using Jdeveloper 10.1.3.0.3.3412 on a Mac with a MySQL database. In Jdeveloper i can make a connection to the database and create adf business components
    I've made a JSP page with ADF on a single table. No errors when compiling. When I try to run the JSP Page using Embedded OC4J (on Mac OSX Tiger) I get the error:
    5/12/09 00:45:50 java.net.ConnectException: Connection refused
    05/12/09 00:45:50      at java.net.PlainSocketImpl.socketConnect(Native Method)
    05/12/09 00:45:50      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    05/12/09 00:45:50      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    05/12/09 00:45:50      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    05/12/09 00:45:50      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:428)
    05/12/09 00:45:50      at java.net.Socket.connect(Socket.java:507)
    05/12/09 00:45:50      at java.net.Socket.connect(Socket.java:457)
    05/12/09 00:45:50      at java.net.Socket.<init>(Socket.java:365)
    05/12/09 00:45:50      at java.net.Socket.<init>(Socket.java:207)
    05/12/09 00:45:50      at oracle.jdevimpl.runner.oc4j.Oc4jNotifier.sendMessage(Oc4jNotifier.java:98)
    05/12/09 00:45:50      at oracle.jdevimpl.runner.oc4j.Oc4jNotifier.postInitApplicationServer(Oc4jNotifier.java:55)
    05/12/09 00:45:50      at com.evermind.server.ApplicationServer.serverExtensionPostInit(ApplicationServer.java:1041)
    05/12/09 00:45:50      at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:927)
    05/12/09 00:45:50      at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:98)
    05/12/09 00:45:50      at java.lang.Thread.run(Thread.java:613)
    What am I doing wrong? The embedded OC4J library is added to the project. I've tried to use the javac compiler. It looks like the OC4J instance cannot make a connection to the db.
    Thanks,
    Martin

    Hello
    I've added the connection to the web.xml, but still get the same error.
    When I go to embedded OC4J preferences and change the JNDI-names of the datasources (global and current-workspace) to the same name (this was default), i get this error message:
    9-dec-2005 9:30:09 com.evermind.server.ApplicationStateRunning initNativeDataSource
    SEVERE: Error creating native data source. The location 'jdbc/MySQLConnectionCoreDS' is already in use.
    05/12/09 09:30:09 Application: current-workspace-app is in state FAILED
    05/12/09 09:30:09 Error instantiating application 'current-workspace-app' at file:/Users/martinsuijs/jdevhome/mywork/myWorldApp/myWorldApp-oc4j-app.xml: Error creating native data source. The location 'jdbc/MySQLConnectionCoreDS' is already in use.
    05/12/09 09:30:14 java.net.ConnectException: Connection refused
    grtz
    Martin

  • Decision Service calls failing with connection refused

    Hi All,
    Breifing of the bpel process - Async bpel process XX_BPEL_ASYNC_002 calls decision services and a sync bpel process XX_BPEL_SYNC_001.
    We have moved to cluster 10.1.3.5.0 from 10.1.3.3.0 and the deployement of the bpel process and the decision service done on two nodes i.e., node51 and node55.
    But the bpel process is able to call the decision service only when the node 51 is UP and running, but if node 51 is down and node 55 is up and running it is failing with connection refused error. It is also working when 55 is DOWN and 051 is UP.
    the exact error is:
    exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection refused.
    We are using file based repository.
    It is failing when it tries to call particular url:
    http://loadbalancerurl:7777/orabpel/domain001/XX_BPEL_ASYNC_002/1.0/decisionservices.decs
    Can anyone please help me or advice me for finding some solution.
    Thanks
    Sreejit

    Hi Fatsah,
    It has been a while since we resolved this problem. But these were  the basic steps that we had taken.
    The receiver was configured a File adatpter with FTP:
    Port: 10021
    Connection security : FTPS (FTP using SSL/TLS) for Control and Data Connection
    Command Order: AUTH TLS,USER,PASS,PBSZ,PROT
    Problem: The message was blocked in our firewall.
    FTPS in this case used 10021 as the control port and the firewall allowed to pass the control request.
    Once the connection was accepted at the control level, it generated a random port number  to pass data on the channel.
    This random port number was blocked in the firewall.
    We monitored the data port numbers generated at firewall. Then we configured the firewall to open any port number  between the specific IP addresses of the sender and the receiver. That resolved the problem.
    Hope this helps!
    Please give points if this is helpful.
    Thank you.
    Dharmasiri Amith

  • Tcp/ip  bconnection to host has failed,connection refused

    Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(UnknownSource)
    Can anyone pls help me out .
    I ve tried netstat -an port 1433 is not listed
    firewall is diasbled .

    You need to enable TCP services on SQL Server.

  • Please help , "Connection refused: connect "

    hello,
    i have got this exception while connecting to server ?
    what does it mean ? and what can i do to solve this problem ?
    this is so important for me ! i have to solve this in a short time.
    thanks for helps.
    Musa YILMAZ
    // == ERROR
    com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
    ** BEGIN NESTED EXCEPTION **
    java.net.SocketException
    MESSAGE: java.net.ConnectException: Connection refused: connect
    STACKTRACE:
    java.net.SocketException: java.net.ConnectException: Connection refused: connect
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:151)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:1765)
    at com.mysql.jdbc.Connection.<init>(Connection.java:430)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at pi.a(pi.java)
    at pi.b(pi.java)
    at Main.<init>(Main.java)
    at tk.run(tk.java)
    at java.lang.Thread.run(Unknown Source)
    ** END NESTED EXCEPTION **

    You are trying to connect to wrong host or port number
    or
    MySQL server that you are trying to connect is not running

  • Please Help - Connection Refused

    Hello,
    I am having trouble connecting to cloudscape database, have been working OK for the past
    couple weeks with an application that I have writen but now big problems!
    java -Djdbc.drivers=COM.cloudscape.core.RmiJdbcDriver Testjava.sql.SQLException: Connection refused to host: localhost; nested exception is:
    java.net.ConnectException: Connection refused: connect
    at RmiJdbc.RJDriver.connect(RJDriver.java:156)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:140)
    at COM.cloudscape.core.RmiJdbcDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:193)
    at Test.getConnection(Test.java:14)
    at Test.main(Test.java:54)
    *I am running cloudscape
    *set the class paths to point at
    - RmiJdbc.jar
    - cloudclient.jar
    I have written a small test program to check problem,
    //////////////////////////////////CODE LISTING/////////////////////////////////////////////
    import java.sql.*;
    import java.util.*;
    public class Test
    { static Connection conn = null;
    static Statement stmt = null;
    static ResultSet rset = null;
    private Test()
    public static Connection getConnection(String url) throws SQLException
    { DriverManager.setLoginTimeout(10);
    return DriverManager.getConnection(url);
    public static void close(Statement stmt)
    { if(stmt != null)
    { try
    { stmt.close();
    }catch(Exception e)
    { e.printStackTrace();
    public static void close(Connection conn)
    { if (conn != null)
    { try
    { conn.close();
    }catch(Exception e)
    { e.printStackTrace();
    public static void close(ResultSet rset)
    { if (rset != null)
    { try
    { rset.close();
    }catch(Exception e)
    { e.printStackTrace();
    public static void main(String [] args)
    { try
    { String url= "jdbc:cloudscape:rmi://localhost:2005/cloudscapeDB;create=true";
    conn = getConnection(url);
    stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
    }catch(SQLException e)
    { e.printStackTrace();
    close(rset);
    close(stmt);
    close(conn);
    Please Help me!!!!

    It is obvious that noone is going to reply to me, so I have kind of solved this for myself,
    for some unknown reason my origonal program that worked fine doesnt now.!?!?!??!?
    However decided to approach problem from another side, and give both my desk and head a break.
    Below is now how I am connecting to a database and return a connection to it, it works,
    public static Connection getConnection() {
    String databaseName = "jdbc:rmi://" + "localhost" + ":1099/jdbc:cloudscape:CloudscapeDB;autocommit=true;create=true";
    try {
    Class.forName("RmiJdbc.RJDriver");
    } catch (ClassNotFoundException e) {
    System.out.println("PopulateTables: caught getting connection: " + e);
    Connection con = null;
    try {
    con = DriverManager.getConnection(databaseName); // , user, password);
    } catch (java.sql.SQLException se) {
    System.out.println("PopulateTables: caught getting connection: " + se);
    return con;
    Thanks me.

  • XSQL-007: Database connection refused

    I am running Demos on JavaWebServer, IE 5.0, Oracle Lite database. When I am trying to access http://Computer:port/xsql/demo/helloworld.xsql
    it is giving me this error, any thoughts...
    XSQL-007: Cannot acquire a database connection to process page.
    Connection refused
    null

    Now my XSQLConfig.xml settings are:
    <connectiondefs dumpallowed="no">
    <connection name="demo">
    <username>SYSTEM</username>
    <password>234khan</password>
    <dburl>jdbc:Polite:POlite</dburl>
    <driver>oracle.lite.poljdbc.POLJDBCDriver</driver>
    </connection>
    <connection name="lite">
    <username>system</username>
    <password>manager</password>
    <dburl>jdbc:Polite:POlite</dburl>
    <driver>oracle.lite.poljdbc.POLJDBCDriver</driver>
    </connection>
    </connectiondefs>
    and I am getting this error:
    500 Internal Server Error
    The servlet named oracle.xml.xsql.XSQLServlet at the requested URL
    http://nw601250:8080/xsql/demo/helloworld.xsql
    reported this exception: java/util/HashMap. Please report this to the administrator of the web server.
    java.lang.NoClassDefFoundError: java/util/HashMap at oracle.lite.poljdbc.OracleConnection.(Unknown Source) at oracle.lite.poljdbc.POLJDBCDriver.connect(Compiled Code) at java.sql.DriverManager.getConnection(Compiled Code) at java.sql.DriverManager.getConnection(DriverManager.java:126) at oracle.xml.xsql.XSQLConnectionPool.newConnection(XSQLConnectionPool.java:256) at oracle.xml.xsql.XSQLConnectionPool.(Compiled Code) at oracle.xml.xsql.XSQLConnectionManager.getPool(XSQLConnectionManager.java:270) at oracle.xml.xsql.XSQLConnectionManager.getPool(XSQLConnectionManager.java:250) at oracle.xml.xsql.XSQLConnectionManager.getConnection(XSQLConnectionManager.java:63) at oracle.xml.xsql.XSQLPageRequestImpl.setConnectionName(XSQLPageRequestImpl.java:189) at oracle.xml.xsql.XSQLPageProcessor.process(Compiled Code) at oracle.xml.xsql.XSQLServlet.doGet(XSQLServlet.java:124) at javax.servlet.http.HttpServlet.service(HttpServlet.java:715) at javax.servlet.http.HttpServlet.service(Compiled Code) at com.sun.server.ServletState.callService(Compiled Code) at com.sun.server.ServletManager.callServletService(Compiled Code) at com.sun.server.ProcessingState.invokeTargetServlet(Compiled Code) at com.sun.server.http.HttpProcessingState.execute(Compiled Code) at com.sun.server.http.stages.Runner.process(Compiled Code) at com.sun.server.ProcessingSupport.process(Compiled Code) at com.sun.server.Service.process(Compiled Code) at com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at com.sun.server.http.HttpServiceHandler.handleRequest(Compiled Code) at com.sun.server.HandlerThread.run(Compiled Code)
    I hope this would be the final step. Please reply thanks
    null

  • SQL Server 2000/CFMX 7 - connection refused: connect

    Hi all,
    I have been trying to troubleshoot this for a few weeks now,
    I have looked high and low and tried multiple solutions that worked
    for other people, none have worked for me.
    I have SQL Server 2000 Version 8 and Coldfusion 7.0.2.
    I can't seem to make a database connect in Administrator. I
    have tried changing the port that SQL Server listens on, I made a
    new security role in SQL Server specifically for the database I'm
    creating, I tried making an ODBC connection (which can see the SQL
    Server) in windows then connecting to that, nothing is working.
    I thought it might be the windows firewall, it isn't since it
    is off, my TCP/IP protocol is enabled, I am running out of ideas.
    If anyone can suggest anything, please do this is what I see
    everytime.
    Connection verification failed for data source: IFDA
    java.sql.SQLException: [Macromedia][SQLServer JDBC
    Driver]Error establishing socket. Connection refused: connect
    The root cause was that: java.sql.SQLException:
    [Macromedia][SQLServer JDBC Driver]Error establishing socket.
    Connection refused: connect
    I'm dying over here.
    Thanks.

    This might be a dumb question, but have you searched Google
    groups? Its one of the first places I go when I get error messages
    I don't understand.
    Googling this:
    "java.sql.SQLException: [Macromedia][SQLServer JDBC
    Driver]Error establishing socket. Connection refused: connect"
    ..gave me 84 results (ok, a lot of them point back to these
    forums but I still find searching thru Google easier than using the
    built in search) - here's a
    Link
    hth - cheers.

  • How to use JDBC to connect Tomcat with database server?(Urgent!)

    I try to deploy the tomcat and make it connect with databaser server.
    I am using mysql connector J 3.0. I added the CLASSPATH of mysql-connector-java-3.0.7-stable-bin.jar in the tomcat.sh .
    I also add the web application in server.xml.
    When I start tomcat, I can see using Classpath including mysql-connector-java-3.0.7-stable-bin.jar .
    But when i browse my jsp including the jdbc, wait for a while, I get a message as following: Timeout on server localhost. My web server and database server is same computer.
    Could you tell me what's wrong?

    Did you check to see that the MySQL database was indeed up and running, and accepting connections when you started Tomcat? Did you make sure that your firewall permits connections to the database?
    Timeout errors generally occur when you send a request to a server and the server does nothing with it - i.e., it doesn't respond to it in any way. Most firewalls are configured this way. If I telnet to your machine and I get "connection refused", I know your machine exists and I can try hacking into it. If I telnet and get nothing at all, then I will either assume either there's no actual machine at that address or it's unresponsive.

Maybe you are looking for

  • IPhone 3G no longer charges?  Not recognized by computer? Win 7

    Last night my iPhone 3G stopped being recognized by my laptop. I can only charge it with the USB wall charger which ***** because now I can't restore or put music on my phone anymore.  This is. Second hand 3G but the same thing happened to my old iPh

  • Why did auto update stop working - check box greyed out!

    I suddenly realized it had been months since I had seen an update at home, but was getting them regularly on my office machine. Checking help about I found I was running 3.0.6, I tried to click the check for updates and it was greyed out. Checking op

  • Can\'t get both rom drives to work at the same time

    HI I  just finished building my new system with the MSI 6585 and everything works well EXCEPT my two roms drives.  I can get one to work or the other to work but not both at the same time.  I have the hard drive on the primary IDE and both rom drives

  • 11.3 File Upload Extension

    Since upgrading to 11.3 we're unable to install the file upload extension for firefox (ESR 24.5) on OS X (tried 10.8 and 10.9 - the extension works fine in win7). The link "Install the Novell File Upload extension to upload directories" is there but

  • E2E tracing in internet explorer 11 and other browser like chrome

    Hi, Currently the sap client plugin for E2E tracing only supports till IE 10(Ref: SAP Note: 1435190 - SAP Client Plug-In). Is there any plan to get the support on other browsers and IE 11. Thanks Sambit