Java.sql.SQLException: The TCP/IP connection to the host  has failed.

Hello. I hope you had a happy new year! Now its back to work.
I am having a problem connecting to a remote SQL Server DB. I am using NetBeans 5.5 and the latest J2EE. I am able to see the tables in the IDE and bind objects to data. But when I run it it gets this:
java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: no further information
at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:100)
at com.sun.sql.rowset.internal.CachedRowSetXReader.connect(CachedRowSetXReader.java:344)
at com.sun.sql.rowset.internal.CachedRowSetXReader.readData(CachedRowSetXReader.java:126)
at com.sun.sql.rowset.CachedRowSetXImpl.execute(CachedRowSetXImpl.java:968)
at com.sun.sql.rowset.CachedRowSetXImpl.execute(CachedRowSetXImpl.java:1428)
I checked the SQL Server Configuration manager on that machine and TCP/IP connections are allowed. What else could be wrong?
Thank You.

"Connection refused" means that the client sends a packet saying "I would like to connect to port number NNNN please" to the server computer, and the server computer's OS sends the reply "there is no process listening to that port on the network interface you are using".
The database server is not running, or running but not listening to TCP/IP connections, or at a different port from what you think, or listening to only selected network interfaces (it is possible for a process to listen to a specific interface or a wildcard for all interfaces). A less likely scenario is that a firewall is sending the "connection refused" message.
First aid check list for "connection refused":
- Check host name in connect string.
- Check port number in connect string.
- Try numeric IP address of server host in connect string, in case name server is hosed.
- Are there any firewalls between client and server blocking the port.
- Check that the db server is running.
- Check that the db server is listening to the port. On the server, try: "telnet localhost the-port-number". Or "netstat -an", there should be a listening entry for the port. You need to configure the database to accept TCP connections; the server documentation or google should explain how.
- Try "telnet server-host-name the-port-number" from the client, to see if firewalls are blocking it.
- If "telnet" fails: try telnet with the numeric ip address.
- If "telnet" fails: does it fail immediately or after an obvious timeout? How long is the timeout?
- Does the server respond to "ping serverhost" or "telnet serverhost" or "ssh serverhost"?

Similar Messages

  • Java.sql.SQLException: Network error IOException: Connection refused:

    hi...i am tryin to connect to sqlserver2000 ....i wanted a dsnless connection...i have downloaded jtds driver...set the classpath..no joy..i'm connecting to sqlserver's default port 1433..i also confirmed that sqlserver tcp is enabled...still gettin the same err:
    java.sql.SQLException: Network error IOException: Connection refused: connect
    at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java
    :385)
    at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java
    :50)
    at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:182)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at SQLServerConnect.getConnection(SQLServerConnect.java:27)
    at SQLServerConnect.displayDbProperties(SQLServerConnect.java:44)
    at SQLServerConnect.main(SQLServerConnect.java:80)
    Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
    at java.net.Socket.connect(Socket.java:507)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSoc
    ket.java:304)
    at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:255)
    at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java
    :310)
    ... 7 more
    Error Trace in getConnection() : Network error IOException: Connection refused:
    connect
    Error: No active Connection
    i even tried connecting to the port 1433 thru telnet...err:Could not open connection to the host, on port 1433:connection failed...
    i thought it cud b a firewall issue...disabled my windows firewall..no joy..
    can ne body help me with this....need to solve this desparately
    thanks in advance
    jude

    Old, but still coming up in google searches. Here's the solution that worked for me:
    Dynamic Port Allocation explained:
    http://support.microsoft.com/kb/823938
    How to: Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager)
    http://support.microsoft.com/kb/823938
    In case that dissappears:
    To assign a TCP/IP port number to the SQL Server Database Engine
    1. In SQL Server Configuration Manager, in the console pane, expand SQL Server 2005 Network Configuration, expand Protocols for <instance name>, and then double-click TCP/IP.
    2. In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear, in the format IP1, IP2, up to IPAll. One of these are for the IP address of the loopback adapter, 127.0.0.1. Additional IP addresses appear for each IP Address on the computer. Right-click each address, and then click Properties to identify the IP address that you wish to configure.
    3. If the TCP Dynamic Ports dialog box contains 0, indicating the Database Engine is listening on dynamic ports, delete the 0.
    4. In the IPn Properties area box, in the TCP Port box, type the port number you wish this IP address to listen on, and then click OK.
    5. In the console pane, click SQL Server 2005 Services.
    6. In the details pane, right-click SQL Server (<instance name>) and then click restart, to stop and restart SQL Server.

  • Java.sql.SQLException: I/O Error: Connection reset on MS-SQL Server 2000

    Anybody able to help me with this Java-JDBC Problem?
    I'm creating a ResultSet and execute a query which approximatelly delivers me 11.000 rows.
    With the given ResultSet i'd like to move through the records forward only.
    In my while loop I'm able to reach ~9700 rows and then unexpectedly i get the error:
    java.sql.SQLException: I/O Error: Connection reset
    at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2277)
    at net.sourceforge.jtds.jdbc.TdsCore.getNextRow(TdsCore.java:761)
    at net.sourceforge.jtds.jdbc.JtdsResultSet.next(JtdsResultSet.java:593)
    at ag.oase.jobs.Datenschaufel.Betriebabgleich(Datenschaufel.java:1629)
    at ag.oase.jobs.Datenschaufel.main(Datenschaufel.java:183)
    Caused by:
    java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:197)
    at java.io.DataInputStream.readFully(DataInputStream.java:202)
    at net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.java:860)
    at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:707)
    at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:466)
    at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:103)
    at net.sourceforge.jtds.jdbc.ResponseStream.readInt(ResponseStream.java:318)
    at net.sourceforge.jtds.jdbc.TdsData.readData(TdsData.java:680)
    at net.sourceforge.jtds.jdbc.TdsCore.tdsRowToken(TdsCore.java:2968)
    at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2236)
    ... 4 more
    I'm using the jTDS JDBC driver.
    I googled a lot but didn't found a solution for this problem?
    So please help me!
    Thanks in advance
    Ren�

    ...OWB repository cannot be installed into Oracle XE.
    Cheers
    David

  • Error: java.sql.SQLException: Internal Error   Invalid Connect String

    hi,
    facing errror while deploying the process
    A problem occured while connecting to server "sfhyd1.softforce.com" using port "8888": bpel_getCustomerAccounts_1.0.jar failed to deploy. Exception message is: java.sql.SQLException: Internal Error:Invalid Connect String
    at com.collaxa.cube.engine.util.DBUtils.checkIfFatalConnectionError(DBUtils.java:920)
    at com.collaxa.cube.ejb.impl.BaseCubeSessionBean.checkIfFatalConnectionError(BaseCubeSessionBean.java:153)
    at com.collaxa.cube.ejb.impl.BPELDomainManagerBean.deploySuitcase(BPELDomainManagerBean.java:462)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:31)
    at com.evermind.server.ThreadState.runAs(ThreadState.java:693)
    at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:34)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
    at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
    at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
    at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
    at DomainManagerBean_RemoteProxy_4bin6i8.deploySuitcase(Unknown Source)
    at com.oracle.bpel.client.BPELDomainHandle.deploySuitcase(BPELDomainHandle.java:319)
    at com.oracle.bpel.client.BPELDomainHandle.deployProcess(BPELDomainHandle.java:341)
    at deployHttpClientProcess.jspService(_deployHttpClientProcess.java:376)
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
    at oracle.security.jazn.oc4j.JAZNFilter$1.run(JAZNFilter.java:400)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:414)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
    at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
    at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
    at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: java.sql.SQLException: Internal Error:Invalid Connect String
    at oracle.lite.poljdbc.POLJDBCErrMsg.throwSQLException(Unknown Source)
    at oracle.lite.poljdbc.LiteThinJDBCConnection.<init>(Unknown Source)
    at oracle.lite.poljdbc.LiteThinJDBCFactory.createConnection(Unknown Source)
    at oracle.lite.poljdbc.POLJDBCConnection.<init>(Unknown Source)
    at oracle.lite.poljdbc.OracleConnection.<init>(Unknown Source)
    at oracle.lite.poljdbc.POLJDBCDriver.connect(Unknown Source)
    at oracle.oc4j.sql.DriverDataSource.getConnection(DriverDataSource.java:116)
    at oracle.oc4j.sql.DriverDataSource.getConnection(DriverDataSource.java:75)
    at oracle.oc4j.sql.DataSourceConnectionPoolDataSource.getPooledConnection(DataSourceConnectionPoolDataSource.java:57)
    at oracle.oc4j.sql.xa.EmulatedXADataSource.getXAConnection(EmulatedXADataSource.java:92)
    at oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createXAConnection(ManagedConnectionFactoryImpl.java:211)
    at oracle.oc4j.sql.spi.ManagedConnectionFactoryImpl.createManagedConnection(ManagedConnectionFactoryImpl.java:170)
    at com.evermind.server.connector.ApplicationConnectionManager.createManagedConnection(ApplicationConnectionManager.java:1398)
    at oracle.j2ee.connector.ConnectionPoolImpl.createManagedConnectionFromFactory(ConnectionPoolImpl.java:327)
    at oracle.j2ee.connector.ConnectionPoolImpl.access$800(ConnectionPoolImpl.java:98)
    at oracle.j2ee.connector.ConnectionPoolImpl$FixedWaitPoolingScheme.getManagedConnection(ConnectionPoolImpl.java:1455)
    at oracle.j2ee.connector.ConnectionPoolImpl.getManagedConnection(ConnectionPoolImpl.java:785)
    at oracle.oc4j.sql.ConnectionPoolImpl.getManagedConnection(ConnectionPoolImpl.java:45)
    at com.evermind.server.connector.ApplicationConnectionManager.getConnectionFromPool(ApplicationConnectionManager.java:1596)
    at com.evermind.server.connector.ApplicationConnectionManager.acquireConnectionContext(ApplicationConnectionManager.java:1541)
    at com.evermind.server.connector.ApplicationConnectionManager.allocateConnection(ApplicationConnectionManager.java:1486)
    at oracle.j2ee.connector.OracleConnectionManager.unprivileged_allocateConnection(OracleConnectionManager.java:238)
    at oracle.j2ee.connector.OracleConnectionManager.allocateConnection(OracleConnectionManager.java:192)
    at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:272)
    at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:200)
    at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:142)
    at oracle.oc4j.sql.ManagedDataSource.getConnection(ManagedDataSource.java:127)
    at com.collaxa.cube.engine.data.ConnectionFactory$ConnectionFactoryImpl.getConnection(ConnectionFactory.java:336)
    at com.collaxa.cube.engine.data.ConnectionFactory.getConnection(ConnectionFactory.java:140)
    at com.collaxa.cube.engine.adaptors.common.BaseProcessPersistenceAdaptor.storeProcess(BaseProcessPersistenceAdaptor.java:361)
    at com.collaxa.cube.engine.adaptors.olite.ProcessPersistenceAdaptor.storeProcess(ProcessPersistenceAdaptor.java:52)
    at com.collaxa.cube.engine.data.ProcessPersistenceMgr.storeProcess(ProcessPersistenceMgr.java:76)
    at com.collaxa.cube.engine.deployment.DeploymentManager.deployProcess(DeploymentManager.java:937)
    at com.collaxa.cube.engine.deployment.DeploymentManager.deploySuitcase(DeploymentManager.java:792)
    at com.collaxa.cube.ejb.impl.BPELDomainManagerBean.deploySuitcase(BPELDomainManagerBean.java:455)
    ... 45 more

    You may possibly modified the oc4j-ra.xml file in the stand-alone directory instead of the file under the OC4J_BPEL directory in midtier.
    Currently, we are seeing some issues with the sample in midtier. So you may like to wait for the GA release [ mid May] for trying out this sample.
    Otherwise please send a mail to [email protected], you need any early drop of this sample.
    HTH.
    Thanks,
    Rakesh

  • Java.sql.SQLException: E/A-Exception: Connection ended abnormally

    Hi all,
    this strange exception occurs in the communication channel monitoring. I see there was a processing error in the communication channel which inserts data from XI. When I look in audit protocol I can see that after a few minutes the connection is ended with an error which says the following:
    Error processing request in sax parser: Error when executing statement for table/stored proc. 'LVS' (structure 'STATEMENTNAME'): java.sql.SQLException: E/A-Exception: Connection ended abnormally.
    Now my questions are: Why does this error occur? And can someone explain me this error?
    Regards
    Florian

    I think I have the reason for this problem. It's a network problem. The network to this system has a high load. In addition, the JDBC receiver adapter was configured with parameter <i>"Disconnect from Database After Processing Each Message".</i> Now I have deselected the parameter and I have no problems.
    Thanks for your efforts
    Florian

  • DAE.DB_READ_FAILED   java.sql.SQLException: Got a null connection

    While adding / updating user in OIM, I am getting error on random basis.
    Sometime the system is allowing to add / update and sometimes it is giving below mentioned error.
    Due to this, there is huge impact on production with 30,000+ users in OIM
    Please help ASAP.
    WARN,29 Aug 2012 14:48:10,813,[XELLERATE.DATABASE],Trying to get the connection count : 0
    WARN,29 Aug 2012 14:48:10,816,[XELLERATE.DATABASE],Trying to get the connection count : 1
    WARN,29 Aug 2012 14:48:10,820,[XELLERATE.DATABASE],Trying to get the connection count : 2
    WARN,29 Aug 2012 14:48:10,823,[XELLERATE.DATABASE],Trying to get the connection count : 3
    WARN,29 Aug 2012 14:48:10,826,[XELLERATE.DATABASE],Trying to get the connection count : 4
    ERROR,29 Aug 2012 14:48:10,827,[XELLERATE.DATABASE],Class/Method: DirectDB/getConnection encounter some problems: Error while retrieving database connection.Please check for the follwoing
    Database srever is running.
    Datasource configuration settings are correct.
    ERROR,29 Aug 2012 14:48:10,828,[XELLERATE.DATABASE],Class/Method: tcDataBase/readPartialStatement encounter some problems: Got a null connection
    java.sql.SQLException: Got a null connection
         at com.thortech.xl.dataaccess.tcDataBase.readPartialStatement(Unknown Source)
         at com.thortech.xl.dataobj.tcDataBase.readPartialStatement(Unknown Source)
         at com.thortech.xl.dataobj.tcDataBase.readStatement(Unknown Source)
         at com.thortech.xl.dataobj.tcDataBase.getError(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.handleError(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.handleError(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
         at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
         at com.thortech.xl.dataobj.tcRCE.reapplyRules(Unknown Source)
         at com.thortech.xl.ejb.databeansimpl.tcRCEBean.reapplyRules(Unknown Source)
         at com.thortech.xl.ejb.beans.tcRCE_4tknfu_EOImpl.reapplyRules(tcRCE_4tknfu_EOImpl.java:45)
         at com.thortech.xl.ejb.beans.tcRCE_4tknfu_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:434)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:429)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    ERROR,29 Aug 2012 14:48:10,829,[XELLERATE.SERVER],Class/Method: tcDataObj/handleError encounter some problems: {1}
    com.thortech.xl.orb.dataaccess.tcDataAccessException
         at com.thortech.xl.dataaccess.tcDataAccessExceptionUtil.createException(Unknown Source)
         at com.thortech.xl.dataaccess.tcDataBase.createException(Unknown Source)
         at com.thortech.xl.dataaccess.tcDataBase.readPartialStatement(Unknown Source)
         at com.thortech.xl.dataobj.tcDataBase.readPartialStatement(Unknown Source)
         at com.thortech.xl.dataobj.tcDataBase.readStatement(Unknown Source)
         at com.thortech.xl.dataobj.tcDataBase.getError(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.handleError(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.handleError(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
         at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
         at com.thortech.xl.dataobj.tcRCE.reapplyRules(Unknown Source)
         at com.thortech.xl.ejb.databeansimpl.tcRCEBean.reapplyRules(Unknown Source)
         at com.thortech.xl.ejb.beans.tcRCE_4tknfu_EOImpl.reapplyRules(tcRCE_4tknfu_EOImpl.java:45)
         at com.thortech.xl.ejb.beans.tcRCE_4tknfu_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:434)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:429)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    Caused by [Nested Exception]:
    java.sql.SQLException: Got a null connection
         at com.thortech.xl.dataaccess.tcDataBase.readPartialStatement(Unknown Source)
         at com.thortech.xl.dataobj.tcDataBase.readPartialStatement(Unknown Source)
         at com.thortech.xl.dataobj.tcDataBase.readStatement(Unknown Source)
         at com.thortech.xl.dataobj.tcDataBase.getError(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.handleError(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.handleError(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
         at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
         at com.thortech.xl.dataobj.tcRCE.reapplyRules(Unknown Source)
         at com.thortech.xl.ejb.databeansimpl.tcRCEBean.reapplyRules(Unknown Source)
         at com.thortech.xl.ejb.beans.tcRCE_4tknfu_EOImpl.reapplyRules(tcRCE_4tknfu_EOImpl.java:45)
         at com.thortech.xl.ejb.beans.tcRCE_4tknfu_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:434)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:429)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    DEBUG,29 Aug 2012 14:48:10,830,[XELLERATE.SERVER],Class/Method: tcDataBase/getError entered.
    DEBUG,29 Aug 2012 14:48:10,831,[XELLERATE.SERVER],Class/Method: tcDataBase/isActionLoggable entered.
    DEBUG,29 Aug 2012 14:48:10,831,[XELLERATE.SERVER],Class/Method: tcDataBase/isActionLoggable left.
    DEBUG,29 Aug 2012 14:48:10,831,[XELLERATE.SERVER],Class/Method: tcDataBase/logError entered.
    ERROR,29 Aug 2012 14:48:10,831,[XELLERATE.DATABASE],Error: Error Keyword: DAE.DB_READ_FAILED
    Description: Could not execute database read. The database encountered a problem with the specified SQL query.
    Remedy: Check the database query. Contact your system adminstrator.
    Action: E
    Severity: H
    Help URL:
    Detail:
    com.thortech.xl.orb.dataaccess.tcDataAccessException: DB_READ_FAILEDDetail: SQL: select err_key, err_code, err_desc, err_rowver, err_remedy, err_count, err_last_occurance, err_action, err_help_url, err_severity from err where err_code='DOBJ.UPDATE_FAILED'Description: Got a null connectionSQL State: Vendor Code: 0Additional Debug Info:com.thortech.xl.orb.dataaccess.tcDataAccessException
         at com.thortech.xl.dataaccess.tcDataAccessExceptionUtil.createException(Unknown Source)
         at com.thortech.xl.dataaccess.tcDataBase.createException(Unknown Source)
         at com.thortech.xl.dataaccess.tcDataBase.readPartialStatement(Unknown Source)
         at com.thortech.xl.dataobj.tcDataBase.readPartialStatement(Unknown Source)
         at com.thortech.xl.dataobj.tcDataBase.readStatement(Unknown Source)
         at com.thortech.xl.dataobj.tcDataBase.getError(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.handleError(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.handleError(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
         at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
         at com.thortech.xl.dataobj.tcRCE.reapplyRules(Unknown Source)
         at com.thortech.xl.ejb.databeansimpl.tcRCEBean.reapplyRules(Unknown Source)
         at com.thortech.xl.ejb.beans.tcRCE_4tknfu_EOImpl.reapplyRules(tcRCE_4tknfu_EOImpl.java:45)
         at com.thortech.xl.ejb.beans.tcRCE_4tknfu_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:434)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:429)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:35)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)

    Hi Nishith,
    max connection pool size is already set to 50 , which is recommended.
    Please Advise.
    Thanks
    Rachit

  • The TCP/IP connection to the host 127.0.0.1 , port 1433 has failed

    hi all,
    i am using SQL2005 server as my database server. i am trying to connect this server in java (i mean using JDBC). i am using windows authentication to connect my sqlserver.
    i have the url connection like this
    DriverManager.getConnection("jdbc:sqlserver://127.0.0.1\\SQL2005/database name",username","password");
    i am trying to connect the server using the above URL, but i couldn't connect it throws an error as the following.
    The TCP/IP connection to the host  127.0.0.1 , port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".
    could anyone plz help me to make the connection in right way.
    i have tried to ping via telnet as well, even telnot not able to connect
    plz help me...
    thanks

    Hi,
    Besides Madhu mentioned, please check the TCP/IP port number of the instance of SQL Server.
    1. Open SQL Server Configuration Manager, and then expand SQL Server 2005 Network Configuration.
    2. Click Protocols for InstanceName, and then make sure TCP/IP is enabled in the right panel and double-click TCP/IP.
    3. On the Protocol tab, notice the value of the Listen All item.
    4. Click the IP Addresses tab:
    If the value of Listen All is yes, the TCP/IP port number for this instance of SQL Server 2005 is the value of the TCP Dynamic Ports item under IPAll.
    If the value of Listen All is no, the TCP/IP port number for this instance of SQL Server 2005 is the value of the TCP Dynamic Ports item for a specific IP address.
    5. Make sure the TCP Port is 1433.
    6. Click OK.
    If there are any more questions, please let me know.
    Thanks.
    ***Xiao Min Tan***Microsoft Online Community***

  • The TCP/IP connection to the host localhost, port 1433 has failed.

    Hi, im using sql server 2000,
    i have declared this in my program:
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    String url = "jdbc:sqlserver://localhost:1433;databaseName=Factura";
    Connection conn = DriverManager.getConnection(url,"sa","");and is giving me this exception:
    run:
    Got an exception!
    The TCP/IP connection to the host localhost, port 1433 has failed.
    Error: "connect timed out.
    Verify the connection properties,
    check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port,
    and that no firewall is blocking TCP connections to the port.".
    com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed.
    Error: "connect timed out. Verify the connection properties,
    check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port,
    and that no firewall is blocking TCP connections to the port.".
            at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:171)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1033)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)
            at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
            at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
            at java.sql.DriverManager.getConnection(DriverManager.java:582)
            at java.sql.DriverManager.getConnection(DriverManager.java:185)
            at factura.FacturaView.conexion(FacturaView.java:317)
            at factura.FacturaView.jTextField1KeyPressed(FacturaView.java:268)
            at factura.FacturaView.access$900(FacturaView.java:41)
            at factura.FacturaView$5.keyPressed(FacturaView.java:150)
            at java.awt.Component.processKeyEvent(Component.java:6225)
            at javax.swing.JComponent.processKeyEvent(JComponent.java:2801)
            at java.awt.Component.processEvent(Component.java:6044)
            at java.awt.Container.processEvent(Container.java:2041)
            at java.awt.Component.dispatchEventImpl(Component.java:4630)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
            at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
            at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
            at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
            at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
            at java.awt.Component.dispatchEventImpl(Component.java:4502)
            at java.awt.Container.dispatchEventImpl(Container.java:2099)
            at java.awt.Window.dispatchEventImpl(Window.java:2478)
            at java.awt.Component.dispatchEvent(Component.java:4460)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    BUILD SUCCESSFUL (total time: 34 seconds)how can i solve this?
    thanks..
    Edited by: derok on Dec 8, 2010 1:31 PM
    Edited by: derok on Dec 8, 2010 9:14 PM
    Edited by: derok on Dec 11, 2010 1:51 PM
    Edited by: derok on Dec 11, 2010 1:52 PM

    tschodt wrote:
    derok wrote:
    1434 did not worked eitherWhat port is your SQL Server listening on?
    List of active ports:
    C:\> netstat -naboOn linux I would add -l and -t to only get listening TCP ports.netstat -nabo gave me this:
    Active Connections
      Proto  Local Address          Foreign Address        State           PID
      TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       2004
      [httpd.exe]
      TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       1148
      e:\windows\system32\WS2_32.dll
      E:\WINDOWS\system32\RPCRT4.dll
      e:\windows\system32\rpcss.dll
      E:\WINDOWS\system32\svchost.exe
      E:\WINDOWS\system32\ADVAPI32.dll
      [svchost.exe]
      TCP    0.0.0.0:443            0.0.0.0:0              LISTENING       2004
      [httpd.exe]
      TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
      [System]
      TCP    0.0.0.0:2869           0.0.0.0:0              LISTENING       1528
      E:\WINDOWS\system32\httpapi.dll
      e:\windows\system32\ssdpsrv.dll
      E:\WINDOWS\system32\RPCRT4.dll
      [svchost.exe]
      TCP    0.0.0.0:3306           0.0.0.0:0              LISTENING       2428
      [mysqld.exe]
      TCP    0.0.0.0:4400           0.0.0.0:0              LISTENING       2592
      [nlsvc.exe]
      TCP    0.0.0.0:7511           0.0.0.0:0              LISTENING       204
      [raysat_3dsmax2010_32server.exe]
      TCP    127.0.0.1:1028         0.0.0.0:0              LISTENING       3080
      [alg.exe]
      TCP    127.0.0.1:5152         0.0.0.0:0              LISTENING       188
      [jqs.exe]
      TCP    192.168.0.101:139      0.0.0.0:0              LISTENING       4
      [System]
      TCP    127.0.0.1:5152         127.0.0.1:1163         CLOSE_WAIT      188
      [jqs.exe]
      TCP    192.168.0.101:2869     192.168.0.1:4563       CLOSE_WAIT      4
      [System]
      UDP    0.0.0.0:500            *:*                                    908
      [lsass.exe]
      UDP    0.0.0.0:445            *:*                                    4
      [System]
      UDP    0.0.0.0:4500           *:*                                    908
      [lsass.exe]
      UDP    0.0.0.0:1434           *:*                                    3036
      [sqlbrowser.exe]
      UDP    127.0.0.1:123          *:*                                    1284
      e:\windows\system32\WS2_32.dll
      e:\windows\system32\w32time.dll
      ntdll.dll
      E:\WINDOWS\system32\kernel32.dll
      [svchost.exe]
      UDP    127.0.0.1:1135         *:*                                    3508
      [iexplore.exe]
      UDP    127.0.0.1:1040         *:*                                    1284
      e:\windows\system32\WS2_32.dll
      E:\WINDOWS\system32\WINHTTP.dll
      E:\WINDOWS\system32\upnp.dll
      E:\WINDOWS\system32\RPCRT4.dll
      E:\WINDOWS\system32\ole32.dll
      [svchost.exe]
      UDP    127.0.0.1:44301        *:*                                    2880
      [PnkBstrA.exe]
      UDP    127.0.0.1:1900         *:*                                    1528
      e:\windows\system32\WS2_32.dll
      e:\windows\system32\ssdpsrv.dll
      E:\WINDOWS\system32\ADVAPI32.dll
      E:\WINDOWS\system32\kernel32.dll
      [svchost.exe]
      UDP    192.168.0.101:1900     *:*                                    1528
      e:\windows\system32\WS2_32.dll
      e:\windows\system32\ssdpsrv.dll
      E:\WINDOWS\system32\ADVAPI32.dll
      E:\WINDOWS\system32\kernel32.dll
      [svchost.exe]
      UDP    192.168.0.101:137      *:*                                    4
      [System]
      UDP    192.168.0.101:123      *:*                                    1284
      e:\windows\system32\WS2_32.dll
      e:\windows\system32\w32time.dll
      ntdll.dll
      -- unknown component(s) --
      [svchost.exe]
      UDP    192.168.0.101:138      *:*                                    4
      [System]Edited by: derok on Dec 10, 2010 11:04 AM
    Edited by: derok on Dec 10, 2010 11:11 AM

  • The TCP/IP connection to the host  has failed.

    Hi everyone;
    I have project with Java and Sql server 2000.My application server is Jetty.I work this tool successfully in Windows 2000 Server but I cant in XP Pro Service Pack 2.I take this message :
    The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect
    My Sql Server TCP/IP enabled and port 1433.There is problem here.Because I cant connect 1433.I tried this command.
    telnet localhost 1433 .It is failed.I tried to open this port in firewall.Still problem is continue.
    I am waiting for ur answer...

    please help me by giving the solution.Help yourself by fixing the connection settings OR your network. The error is very clear: no connection can be made to the database. So what could it be? Wrong IP? A firewall is blocking you somewhere?
    Nobody can tell you, you are the only one with access to your server settings and network environment.

  • ES2: The TCP/IP connection to the host has failed

    A very simple error message appears against a stalled livecycle process which runs upon a flex form submission. You'd think that the connection to the server was lost.This custom process ("completion") is attempting to write out to the backend database at that time.
    However,the "read" process to prepopulate the form already correctly uses the same JNDI connection. And that works. Every time.
    The solution was to go into the "completion" process and move around the individual nodes, re-save and deploy again
    Why is this - seems to be more problems in ES2 than we bargained for perhaps.

    "Connection refused" means that the client sends a packet saying "I would like to connect to port number NNNN please" to the server computer, and the server computer's OS sends the reply "there is no process listening to that port on the network interface you are using".
    The database server is not running, or running but not listening to TCP/IP connections, or at a different port from what you think, or listening to only selected network interfaces (it is possible for a process to listen to a specific interface or a wildcard for all interfaces). A less likely scenario is that a firewall is sending the "connection refused" message.
    First aid check list for "connection refused":
    - Check host name in connect string.
    - Check port number in connect string.
    - Try numeric IP address of server host in connect string, in case name server is hosed.
    - Are there any firewalls between client and server blocking the port.
    - Check that the db server is running.
    - Check that the db server is listening to the port. On the server, try: "telnet localhost the-port-number". Or "netstat -an", there should be a listening entry for the port. You need to configure the database to accept TCP connections; the server documentation or google should explain how.
    - Try "telnet server-host-name the-port-number" from the client, to see if firewalls are blocking it.
    - If "telnet" fails: try telnet with the numeric ip address.
    - If "telnet" fails: does it fail immediately or after an obvious timeout? How long is the timeout?
    - Does the server respond to "ping serverhost" or "telnet serverhost" or "ssh serverhost"?

  • ODI Agent error: java.sql.SQLException: Invalid column name

    When running a scenairo on a standalone ODI agent, it hangs on "Wait" state. The ODI agent's log is logging the following errors over and over again.
    We are in Fusion Application Development and are using Middleware D8B4A RC5.
    [2011-01-07T14:35:16.381-08:00] [odi] [WARNING] [] [oracle.odi.agent] [tid: 4215] [ecid: 0000IpYbCrKE8TQRyaJ7D01D8^zE00009o,0] /oraclediagent/invoke.do[[
    oracle.odi.core.security.SecurityManager.doODIInternalAuthentication(SecurityManager.java:356)
    oracle.odi.core.security.SecurityManager.createAuthentication(SecurityManager.java:331)
    oracle.odi.runtime.agent.servlet.AgentServlet.doPost(AgentServlet.java:418)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:503)
    org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389)
    org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
    org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    org.mortbay.jetty.Server.handle(Server.java:326)
    org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
    org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
    org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:749)
    org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:219)
    org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
    org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)
    [2011-01-07T14:35:18.341-08:00] [] [ERROR] [ODI-1131] [] [tid: 4214] [ecid: 0000IpYaiZCE8TQRyaJ7D01D8^zE00009n,0] [arg: OracleDiAgent] [arg: java.sql.SQLException: Invalid column name] Agent OracleDiAgent encountered an error: java.sql.SQLException: Invalid column name

    Are you sure the datasources point to the right master/work configuration, and that your repository is correctly up-to-date? This looks like the agent trying to connect a repository, but the repository is not updated correctly, or misses some columns. The whole stack (and the name of the missing column) would help of course.

  • (wls61sp4)java.sql.SQLException: Invalid column number [jDriver for MSSQL]

    Hi,
    Could any one help me?
    We use weblogic 6.1 SP4 and SQL2000 SP3, and we weblogic's JDBC driver(mssqlserver4v65).
    It seems the JDBC connections is not stable and sometimes throw the exceptions:
    ==========================================
    java.sql.SQLException: Invalid column number (2). This table has 1 columns (a valid index is 1 trough 1).
    java.sql.SQLException: Invalid column number (2). This table has 1 columns (a valid index is 1 trough 1).
         at weblogic.jdbc.mssqlserver4.TdsResultSet.getEntry(TdsResultSet.java:193)
    ===========================
    Thank you.
    --Ted

    Ted wrote:
    Hi,
    Could any one help me?
    We use weblogic 6.1 SP4 and SQL2000 SP3, and we weblogic's JDBC driver(mssqlserver4v65).
    It seems the JDBC connections is not stable and sometimes throw the exceptions:
    ==========================================
    java.sql.SQLException: Invalid column number (2). This table has 1 columns (a valid index is 1 trough 1).
    java.sql.SQLException: Invalid column number (2). This table has 1 columns (a valid index is 1 trough 1).
    at weblogic.jdbc.mssqlserver4.TdsResultSet.getEntry(TdsResultSet.java:193)
    ===========================
    Thank you.
    --TedCan you reliably reproduce this? Are you sure the query being sent returns
    more than one column? You should be using the mssqlserver4v70, not v65, for
    sqlserver2000.
    Joe

  • Catching  java.sql.SQLException:

    ok this might be a stupid question
    but say i had a dataTable populated by a resultSet,
    when i update the dataTable how i can catch the java.sql.SQLException's being thrown
    i.e the PK exception
    i know i could catch it in the web.xml but was wondering if i can catch it in my bean?

    Oh boy. You may want to go back and take Sun's exception tutorial. It's a fundamental concept. That having been said:
    String sql = "some spiffy SQL goes here";
    Connection conn = null;  // initialize in a spiffy way
    PreparedStatememt stmt = null;
    try {
       stmt = conn.prepareStatement(sql);
       stmt.executeUpdate();  // assume an exception will be thrown
    catch (SQLException e) {
       e.printStackTrace();  // handle error processing
    finally {
      // ensure all resources are released regardless of success or failure
       if (stmt != null) try { stmt.close(); } catch (SQLException ignore) { ignore.printStackTrace() }
      if (conn != null) try { conn.close(); } catch (SQLException ignore) { ignore.printStackTrace() }
    }- Saish

  • Com.microsoft.sqlserver.jdbc.SQLServerException The TCP/IP connection  fail

    * While executing the following JDBC code with SQLServer 2005, it throws Exception
    * I dont wts wrong in my code, (Note: I have included the sqljdbc.jar in my path)
    * Pls let me know the problems in my code
    * Thanks, Following is my code and error
    My Coding :
    import java.sql.*;
    public class JDBCwithJava {
         public void work() {
               // Create a variable for the connection string.
               String connectionUrl = "jdbc:sqlserver://localhost:1433;" +"databaseName=empdb";
               // Declare the JDBC objects.
               Connection con = null;
               Statement stmt = null;
               ResultSet rs = null;
               try {
                    //Load the driver
                  Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
                  // Establish the connection.
                  con = DriverManager.getConnection(connectionUrl);
                  System.out.println("Database Successfully Connected...!");
                  //Connection Info
                  DatabaseMetaData dm = con.getMetaData();
                 System.out.println("Driver Information");
                 System.out.println("\t Driver Name: "+ dm.getDriverName());
                 System.out.println("\t Driver Version: "+ dm.getDriverVersion ());
                 System.out.println("\n Database Information ");
                 System.out.println("\t Database Name: "+ dm.getDatabaseProductName());
                 System.out.println("\t Database Version: "+ dm.getDatabaseProductVersion());
                  // Create and execute an SQL statement that returns some data.
                  String SQL = "select  * from emptable";
                  stmt = con.createStatement();
                  rs = stmt.executeQuery(SQL);
                  // Iterate through the data in the result set and display it.
                  while (rs.next()) {
                     System.out.println(rs.getInt(1) + " " + rs.getString(2));
               // Handle any errors that may have occurred.
               catch (Exception e) {
                  e.printStackTrace();
               finally {
                  if (rs != null)
                       try {
                            rs.close();
                      catch(Exception e) {
                  if (stmt != null) try { stmt.close(); } catch(Exception e) {}
                  if (con != null) try { con.close(); } catch(Exception e) {}
         public static void main(String ar[]){
              JDBCwithJava call = new JDBCwithJava();
              call.work();
    Error :
    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(Unknown Source)
         at JDBCwithJava.work(JDBCwithJava.java:17)
         at JDBCwithJava.main(JDBCwithJava.java:58)

    Do you have SQL Server on your box? Is it listening on port 1433?
    I also don't see any username/password information provided to the JDBC driver.

  • Java.sql.SQLException:Exhausted Resultset

    Hi,
    I am Getting java.sql.SQLException:Exhausted Resultset after filling up the form and clicking submit button so that values inserted in to Database but instead of insertion iam getting this error.
    ThankQ
    Regards
    Saikishore

    You are trying to call a closed resultset.
    check your code. if u don't find then post your relavant code
    (Dhananjay Singh)

Maybe you are looking for