AccessControlException when establishing socket connecion within servlet

Hello good people!
I need to use a socket connection within the function doGet() of HttpServlet.
The code is as following:
public void doGet (HttpServletRequest request,
          HttpServletResponse response) throws ServletException, IOException
     Socket socket;
     OutputStream outStream;
     InputStream inStream;
     String transID;
     PrintWriter out = null;
     transID = request.getParameter("transID");
     try
          out = response.getWriter();
response.setContentType("text");
          //creation and connection of socket.
          socket = new Socket("147.161.2.170", 7665);
outStream = socket.getOutputStream();
          inStream = socket.getInputStream();
          outStream.write(transID );
          byte[] locRes = new byte[ANSWER_SIZE];
          int readSize = inStream.read(locRes);
          locStr = new String(locRes, 0, readSize);
          out.println("hello");
     catch(Exception e)
          out.println(e.getMessage() + " " + e.toString());     
Lhe line "socket = new Socket("147.161.2.170", 7665);" causes an Exception which is caught in the catch clause, and as result I get the following:
access denied (java.net.SocketPermission 147.161.2.170:7665 connect,resolve) java.security.AccessControlException: access denied (java.net.SocketPermission 147.161.2.170:7665 connect,resolve)
What's its problem??
Is there any problem in establishment of socket connection within a HttpServlet?
Please help, all of you!
Thanks beforehand

someone hears me???
help!!!

Similar Messages

  • Open client socket from within a Web Service

    Hello,
    I need to open a client TCP/IP socket from within a Web Service-type WebLogic
    Workshop app. When I try to read from the socket, the socket read operation hangs.
    When I use the same code in a J2SE Java app on the same machine using Eclipse
    everything works fine. It also works fine from within WebLogic, if I use a "URL"
    object instead of a "Socket" object. (However, I cannot use this type of connection.)
    Can anyone tell me how to work with raw TCP/IP sockets in this situation?

    Hi Udi,
    I have tested my code from within a Servlet and it works fine.
    The Servlet and the Web Service both call the same simple JAVA class. This class wants to access a DB, and therefor, I am using the Data Source.
    When the Servlet calls the class, everything works fine. But when I use the Web Service to call this class, I get the Exception "No attributes are implemented".
    I hope this information helps you understanding my problem?
    Thank you very much for your help.
    Kind regards,
         Nadine

  • Establishing Socket Connection to a slow or busy server

    Currently, I'm developing an AIM-based BOT application in Java and it requires establishing a socket connection to their free and public server (host: toc.oscar.aol.com, port: 9898).
    About 75% of the time a connection will be successfully established using this:
    oConnection = new Socket("toc.oscar.aol.com", 9898);
    25% of the time when a connection fails (timeout) is due to the server being too slow or busy to respond to the connection request; however, the server will eventually response within 40 to 60 seconds.
    Let me go into details with my findings when attempting to connect to the slow/busy server:
    For experimental purposes, I used the telnet command (via the DOS command prompt: "telnet toc.oscar.aol.com 9898"), the connection will be established usually within 40 to 60 seconds.
    As I said before, the BOT application is developed in a Java environment and when attempting to establish a connection (using Java's Socket), a timeout exception gets raised when it hits the 20-seconds mark. It tells me that the Java Socket has the timeout defaulted to 20-seconds.
    I am aware that we can define the timeout settings using Socket's "setSoTimeout(x)" method; however, it's only good for AFTER a connection is established.
    Now, to sum up my findings � it clearly shows that the DOS' telnet prompt has longer "wait time" before raising any exceptions. As far as Java Socket is concerned, if a connection is not established within 20 seconds, it raises the timeout exception.
    Is there a way to stretch the "wait time" or "timeout" to be longer than 20 seconds for when a socket connection is being attempted?
    Millions of thanks in advance,
    Chad W. Taylor

    Yes, I also tried that option but no cigar. That
    timeout value is an alternative way of using
    setSoTimeout(int).
    I don't think so.
    First the Java documentation would not make sense:
    public void connect(SocketAddress endpoint, int timeout)
    throws IOException
    Connects this socket to the server with a specified timeout value. A timeout of zero is interpreted as an infinite timeout. The connection will then block until established or an error occurs.
    Parameters:
    endpoint - the SocketAddress
    timeout - the timeout value to be used in milliseconds.
    Throws:
    IOException - if an error occurs during the connection
    SocketTimeoutException - if timeout expires before connecting
    IllegalBlockingModeException - if this socket has an associated channel, and the channel is in non-blocking mode
    IllegalArgumentException - if endpoint is null or is a SocketAddress subclass not supported by this socket
    Since: 1.4
    Second my tests indicate otherwise:
    public class Main {
    public static void main(String[] args) {
    try {
         Socket conn = new Socket();
         conn.connect(new InetSocketAddress(InetAddress.getByName("toc.oscar.aol.com"),9898), Integer.parseInt(args[0]));
         System.out.println("connected under " + args[0] + " seconds");
         conn.close();
    } catch (Exception e) {
         System.out.println("not connected in " + args[0] + " seconds");
         e.printStackTrace();
    Different runs show:
    connected under 120 seconds
    and
    not connected in 20 seconds
    java.net.SocketTimeoutException: connect timed out
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at Main.main(Main.java:21)
    I speculate that the "Connection Request Timeout"
    value is platform dependent because when I use a
    different machine, the request timeout is either
    longer or shorter than 20 seconds.
    That could well be the case.
    So the proper question would be -- where is the Java
    Socket borrowing the timeout value from? The settings
    in Winsock?
    That I don't know.
    Andreas
    Chad

  • "Error establishing socket" error on JDBC Receiver Channel.

    Dear All,
    Scenario: Soap to JDBC.
    I m getting error on JDBC Receiver Channel. messages are processed succesfully on ABAP Stack and receiver channel is on below error:
    ERROR : Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error when attempting to get processing resources: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: DriverManagerException: Cannot establish connection to URL 'jdbc:microsoft:sqlserver://156.5.202.194:3312;DatabaseName=ODW': SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
    Note: i already tested another interface with this same IP and it was fine with different port.
    jdbc:microsoft:sqlserver://IP:PORT;DatabaseName=Name
    Regards,
    Manikandan

    and it was fine with different port
    socket exception is (always) related to port....did you check with the network team about this new Port?

  • Error Establishing Socket jdbc

    hello guys i have the problem of error establishing socket in tomacat 4.0.1 and i am using sqlserver 2000.My Application works well for n number of users but then application server hangs giving the "error establishing socket".
    i am closing all the statements and i am calling connection object in init() and closing it in destoy(). And I am not using connection pooling.
    please specify the changes needed to work with SQL server connection with jdbc
    do help me guys its urgent for me
    tell me as soon as possible.

    hello guys i have the problem of error establishing
    socket in tomacat 4.0.1 and i am using sqlserver
    2000.My Application works well for n number of users
    but then application server hangs giving the "error
    establishing socket".
    i am closing all the statements and i am calling
    connection object in init() and closing it in
    destoy(). And I am not using connection pooling.
    please specify the changes needed to work with SQL
    server connection with jdbc
    do help me guys its urgent for me
    tell me as soon as possible. sql server and windows are terrible under load. i know this from
    personal experience ahving spent a great deal of time fixing an ASP site
    that used ADO to access SQL Server 2000. what happens eventually with
    windows and sql server is that when the server gets really busy the os
    does not prioritize itself very well and you can run out of sockets
    temporarily because even though you have programmtically released them
    the operating system is still holding on to them.
    part of the solution i used was to use pooled connections. i suggest the
    same for you.

  • 'Error establishing socket' due to too many TCP sockets

    Hallo
    I have an app running on Win 2000, SP 3, JRE 1.2, connecting with a MSSQL 2000 DB using MS JDBC drivers and constantly writing updates to this DB. It starts off fine and continues for quite some time before encountering the following exception:
    java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]Error establishing socket.
    Checking the output from netstat while the application is running revealed a huge number of sockets which are aparently used by the application since closing the application causes all these connections to be closed. I assumed that this may be the cause of the exception.
    The application only connects with the database once and statements and resultsets are closed after use.
    The same application running at other sites with more-or-less the same environment does not cause as many open sockets.
    Can anybody tell why so manu sockets are created and not closed ? Any suggestions will be much appreciated.
    Regards
    Dawie

    As an update, I was using connection pooling, and removed it. Now I create a connection per request and explicitly close the connection when done. This accomplished two things, reduced the number of stale connections, and also "throttled" down the process somewhat (not by much as in testing I found the average response times slowed by only a couple milliseconds).
    I did do a netstat on the application server when I started receiving all the errors and found, like dawiemoller did, there was a VERY large number of stale connections to the SQL 2000 server. I wasn't able to telnet into the SQL server and port, as expected. Restarting the Java app on the application server cleared up all the stale connections.
    After I removed the connection pooling, I've yet to receive the "error establishing socket" error, however after checking netstat again, I did find that there are still a lot of stale connections, just not nearly as many.
    If this is a Microsoft bug, why would the stale connections go away after restarting the Java Application? Microsoft IIS is also running on the same server with database access to the SQL 2000 server and it isn't having any trouble. Could it be just a combination of this "bug" and using Microsoft's JDBC driver (SP1) to SQL 2000? Would switching to another vendors JDBC driver avoid this problem?
    Scott Reynolds

  • SQL Server 2000 Driver for JDBC - Error establishing sockets

    Hi there
    I am using Microsoft SQL Server 2000 Driver for JDBC to connect to SQL Sever 2000. It is just a test application to see if it would connect to the datacase successfully. But I got the following errors. I already set up the classpath and installed all SQL Server 2000 Driver for JDBC sp 3. Dont know why it still failed...can anyone help me out of this? Thanks.
    When i am using simple JDBC-ODBC bridge Driver it's working fine.
    For this Server Pack3 , i have checked every thing like--
    TCP / IP Poart is Enable.
    I am working in client machine, my MSSQLServer 2000 Placed in server Machine.
    when i am giving Telnet ServerIP 1433 it's giving following response.
    connecting to ServerIP ....... could not open connection to the host , on port 1433:connection Failed
    My Sample Code is :--
    String user="sa";
    String password="imcindia";
    Connection con1 = null;
    CallableStatement cstmt = null;
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
    con1=DriverManager.getConnection("jdbc:microsoft:sqlserver://ServerName:1433;DatabaseName=dmo1o2d",user,password);
    Statement st=con1.createStatement();
    st.execute("use dm0102d");
    st.execute("setuser 'dm01012'");
    cstmt = con1.prepareCall("{?=Call dms_ex_create_folder('ABC','18753','NB21','u')}");
    cstmt.execute();
    Here are Error Code :
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
         at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
         at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
         at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
         at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
         at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
         at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Connection refused: connect
         at java.sql.DriverManager.getConnection(Unknown Source)
         at TestConnection1.main(TestConnection1.java:24)
    one can help me to over come this problm,
    Thanks in advance.
    venkat

    hey i also have this problem i have been looking for solution for this problem for along time i tried every possible solution i tried every service pack for the SQL but it didn't connect to the port!!!
    it's a network problem ur java code is correct dont worry about it.
    finally i had to install MySQL and it's work fine now but if u insist on usning SQL u have to use the JDBC-ODBC Bridge it will work by :
    first add data source database , follow these steps
    1- go to Administrative tools
    2-Data Sources(ODBC)
    3-System DNS tab and add then choose SQL SERVER the last option then finish
    4-write the name; Note: this name is the one that u will write in ur URL for example if u write Hello the URL will be "jdbc:odbc:Hello"
    5- choose the server, its recommended to write "." or (local)
    6-change the database to its an important step to choose the database that u want to use, choose northwind if u want to use it
    finish
    second
    adding this code:
    import java.sql.*;
    class JdbcTest1 { 
    public static void main (String[] args) { 
    try { 
    // Step 1: Load the JDBC driver.
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    // Step 2: Establish the connection to the database.
    String url = "jdbc:odbc:Hello";
    Connection conn = DriverManager.getConnection(url,"user1","password");
    } catch (Exception e) { 
    System.err.println("Got an exception! ");
    System.err.println(e.getMessage());
    it will work without any problems

  • JDBC Error Establishing Socket

    Hi, I've a problem with my JDBC connection to the SQL Server Database in my Java file. I got a "Error Establishing Socket" problem when I tried to access a database in another server. Can someone tell me what are the possible causes?

    firewall... server not running... etc etc

  • Error establishing socket. Address already in use

    Running CFMX 6.1 on Win2k3, I just recently started getting
    these errors from connections to one of our SQLServer database
    servers (2000, enterprise):
    quote:
    Error Executing Database Query.[Macromedia][SQLServer JDBC
    Driver]Error establishing socket. Address already in use: connect
    Any ideas what might cause this?

    ok. well, if you think that was useless, you might as well
    not read on... this isnt a coldfusion error. it only appears that
    way because you are using cfml. this is a most probably an SQL
    issue. i say most probably, because there are many reasons this
    could be happening. try doing things in these steps as they are in
    degrees of harshness.
    1. check the server event log, see if you have an entry like
    this
    'You are running a version of Microsoft SQL Server 2000 or
    Microsoft SQL Server 2000 Desktop Engine (also called MSDE) that
    has known security vulnerabilities when used in conjunction with
    the Microsoft Windows Server 2003 family. To reduce your computer's
    vulnerability to certain virus attacks, the TCP/IP and UDP network
    ports of Microsoft SQL Server 2000, MSDE, or both have been
    disabled. To enable these ports, you must install a patch, or the
    most recent service pack for Microsoft SQL Server 2000 or MSDE from
    [L=http://www.microsoft.com/sql/downloads/default.asp]http://www.microsoft.com/sql/downlo ads/default.asp[/L]
    [L=http://www.microsoft.com/sql/downloads/default.asp'</[/L]]http://www.microsoft.com/sql/downloads/default.asp'</[/L][/L]
    install sp4
    [L=http://www.microsoft.com/sql/downloads/2000/sp4.mspx]http://www.microsoft.com/sql/down loads/2000/sp4.mspx[/L]
    2. change your database server name to its IP (if that doesnt
    work, you might as well change it back)
    3. make sure you are authenticating with an SQL account.
    windows integrated authentication does not work well ... in your
    SQL enterprise manager, set it to mixed authentication in the
    security tab, select SQL server and windows authentication. the
    microsoft driver seems to not handle the windows authentication
    properly. i wouldnt use the the SA account, create another one just
    for this purpose.
    4. under the general tab in your enterprise manager click
    network configuration. enable TCP/IP which is not enabled by
    default
    5. Install SQL Server 2000 sp3 or sp4
    and here are some other useless articles you might want to
    read...
    Know bug in SQL Server preventing it from listening on port
    1433
    [L=http://support.microsoft.com/default.aspx?scid=kb;en-us;306865]http://support.microsoft .com/default.aspx?scid=kb;en-us;306865[/L]
    [L=http://support.microsoft.com/default.aspx?scid=kb;en-us;329329]http://support.microsoft .com/default.aspx?scid=kb;en-us;329329[/L]
    info on clustered SQL servers
    [L=http://support.microsoft.com/default.aspx?scid=kb;en-us;815431]http://support.microsoft .com/default.aspx?scid=kb;en-us;815431[/L]

  • Error in Establishing socket !

    Hi
    i read the all previous forum related to this
    Problem "Error in establishing socket "
    i done all operations in that forum issue
    i have SQL2000 , & drivers connected with one SQL 2000
    server but when i try to connect it on diff machine then
    it throws the Exception "Error in establishing socket "
    can any one help me .
    thanx in advance .

    The possible reasons I could think of:
    1. The server is not running.
    2. The server is running but TCP/IP is not enabled [you need to select TCP/IP in Enabled Protocols]. You could run netstat to check.
    3. You have a firewall which is prevent the connection from being established.

  • Error establishing socket

    I have an applet which Dynamically builds and updates a JTree. I have signed this applet with a Thawte Certificate and I runs great on our intranet. When I try to access the applet from the Internet I get an error:
    java.SQL.SQLException: [MERANT][SQLServer JDBC Driver]: Error establishing socket
    I am using Merant's type 4 JDBC driver. Any suggestions????

    Make sure the port is open for the applet to talk. Look into the permissions or Browser Settings.

  • AttachToDocument - Error establishing socket.

    I'm encountering a problem where the calls to attachToDocument are generating SQLExceptions (CWS in Java for 4.5WS). It's a strange error that I am unfamiliar with. Please advise on how to fix this. Here is the complete stack trace:
    java.sql.SQLException: Pool connect failed : weblogic.common.ResourceException:
    0:Could not create pool connection. The DBMS driver exception was: [BEA][SQLServ
    er JDBC Driver]Error establishing socket. Too many open files - with nested exce
    ption:
    [weblogic.common.ResourceException: Could not create pool connection. The DBMS d
    river exception was: [BEA][SQLServer JDBC Driver]Error establishing socket. Too
    many open files]
    at weblogic.jdbc.common.internal.JDBCUtil.wrapAndThrowResourceException(
    JDBCUtil.java:160)
    at weblogic.jdbc.pool.Driver.connect(Driver.java:155)
    at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:444)
    at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
    ce.java:298)
    at com.ml.mlim.enterprise.common.util.MCServiceLocator.getDBConn(MCServi
    ceLocator.java:183)
    at com.ml.mlim.marketing.estudio.cws.DocumentProvider.connect(Unknown So
    urce)
    at com.ml.mlim.marketing.estudio.cws.DocumentProvider.getConnection(Unkn
    own Source)
    at com.ml.mlim.marketing.estudio.cws.DocumentProvider.initialize(Unknown
    Source)
    at com.plumtree.remote.crawler.NativeDocumentProvider.Initialize(NativeD
    ocumentProvider.java:47)
    at com.plumtree.remote.crawler.xp.XPDocumentProvider.Initialize(XPDocume
    ntProvider.java:62)
    at com.plumtree.remote.crawler.soap.DocumentProviderSoapBindingImpl.Init
    ialize(DocumentProviderSoapBindingImpl.java:73)
    at com.plumtree.remote.crawler.soap.DocumentProviderSoapBindingSkeleton.
    Initialize(DocumentProviderSoapBindingSkeleton.java:150)
    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:324)
    at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.j
    ava:402)
    at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider
    .java:309)
    at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:
    333)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
    y.java:71)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
    at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:481
    at org.apache.axis.server.AxisServer.invoke(AxisServer.java:323)
    at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:85
    4)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBas
    e.java:339)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1053)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:387)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:6310)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    118)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3622)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    This is happening because you are running out of file descriptors. You can see how many file descriptors you have open by using the following command:
    lsof -p<process id of your JVM>
    Cause: you might have a file descriptor leak. The oracle OCI driver is known to have this type of issue! You must find out what is causing this leak. Or if you are not closing your connections. Use the lsof command to monitor your file descriptors and try to isolate the leak.
    Fix: Increase the number of file descriptor to 4096 if you still run out you must restart the process to rest them to 0. If you have a leak you must address it if not it could be a case of you application just needing more desciptors.
    Email me if you want to talk more:
    [email protected]

  • Intermittent error establishing socket on SQL Server 2000

    I have a suite of 130 JUnit tests. Recently, they started to give me intermittent "error establishing socket" errors when trying to connect to a local instance of SQL Server 2000 via JDBC.
    Each test creates one or more connections. I've used wrappers to prove that I'm closing all of the connections, statements, prepared statements and result sets. The first 70 or 80 tests succeed. After that every test gets the "error establishing socket" exception. Sometimes (but not always) SQL Server continues to refuse connections when I re-run the suite. When that happens I have to let it sit for 30 seconds or so (or restart the server) before it will accept connections.
    I've tested this with both Microsoft's and WebLogic's JDBC drivers with the same results. There's nothing in the SQL Server logs when this happens. There's nothing in the Windows event logs, either.
    If I sleep for 5 seconds between each test the problem goes away.
    I installed the latest service pack (SP3a) for SQL Server 2000 with no change in behavior.
    All of this leads me to believe that something is wrong with SQL Server. Has anyone else run into this problem? Any ideas?

    I am not overly familiar with the SQL Server network architecture, but there are scenarios that could explain your intermittent failures.
    When you connect to a database one of two things can happen, you can start your own process on the server that acts as communication to from the server locally, or you are put in a queue for a static (shared) process that does the same thing.
    Assuming that most databases are initially setup with singular processes per connection, and you have established a connection then you disconnect from the database you do not automatically or instantly kill your process running on the server. There are two primary reasons for this as far as I know. First, the database puts more priority on doing something then doing nothing. Cleaning up and removing your process would be considered doing nothing, accepting incoming connections would be considered doing something. Second, the process may have to stay around to ensure all commit or rollback is completed properly (not always true in every database).
    So, I would expect that there is a connection limit (perhaps between 50-80) that you are exceeding because you are firing these connections rapidly and even though you close the connection in your remote program, the database simply doesn't keep up. Most databases will "cleanup" reasonably quickly if they have the resources to do so, so if you were to put a 30 second delay between every connection it would probably work just fine. It would probably work fine if you put a 30 second delay between after every 20 connections too. It's a bit of balancing act.
    There would be a couple of ways to alleviate this constraint. Putting in delays can demonstrate that this is in fact a work load problem (constrained by total count of connections), but doesn't really help in production instances. You can change the maximum number of connections allowed by the database, however this threshold may be caused by hardware resource (memory) limitations as much as it is a parameter in the database. You may have to add memory to accommodate this many connections. You may have to constrain how much memory each connection gets (again controlled by database parameters). You may have to accept this as a resource constraint and write your code accordingly. This often manifests itself by taking advantage of transaction managers (or transaction manager logic) that will queue up requests until database resources are available.
    Again, I'm not a SQL Server expert, but I'm reasonably certain that most of what I said applies if not specifically at least generally.
    Good Luck.

  • Error Establishing Socket with SQL Server 2000

    I have a java application that uses JDBC to connect to a source of data.
    The application has been installed on many platforms using many different data sources, but one combination has beaten me.
    I am using Windows Server 2003 and SQL Server 2000 Enterprise, when the application starts up it fails to connect to the database with the following message:
    [Microsoft][SQL Server 2000 Driver for JDBC] Error Establishing Socket
    I have looked at a lot of forums and tried many things but nothing has fixed the problem for me:
    To summarise:
    The URL I am using is jdbc:microsoft:sqlserver://locahost:1433
    I have also tried using the name of the machine and it's actual IP address
    I have checked that TCP/IP is enabled and using the correct port (1433)
    Both SQL Server and Windows authentication are enabled and I can connect using both method from ODBC
    I can connect to it and use it with c#.net, vb.net and ODBC from the same machine
    I have installed the latest SQL Server 2000 service pack
    The application works with SQL Server 2000 Developer on Windows XP
    If anyone has any other suggestions, I would love to hear from you.

    If you printed out the SQL state and error code that would be a bit more info:
    catch (SQLException e)
        e.printStackTrace();
        System.err.println("SQL state: " + e.getSQLState());
        System.err.println("SQL error: " + e.getErrorCode());
    }Maybe that will give you more detail as to exactly why this is happening.
    The only other thought I had was security. Maybe there's a permission to access the port that would have to be granted explicitly as part of M$'s new emphasis on security. You did say it was Windoze Server 2003. Maybe that's the difference between all the other installs and this one.
    No joy from me, sorry. - MOD

  • Getting "Error Establishing Socket " error while running the application

    Hi,
    Can Any one help me as I getting the following error while inserting data into database for after some rows and will insert for some rows then again some error . I googled but but didnt get any proper solution.
    Soultion what I got it is
    1) turn off windows firewall.
    2) change server TCP/IP settings.
    3) It will give probelm with windows XP SP 2
    I tried all but didnt able to solve that.
    I am using Java 1.5, MSSQL server 2000,and eclipse 3.2,windows XP SP2
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
    at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
    at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
    at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
    at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
    at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
    at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at com.aztecsoft.quality.DatabaseConnectionQLTYSRV.getCon(DatabaseConnectionQLTYSRV.java:25)
    at com.aztecsoft.quality.DatabaseQuery.getDaytoCountRow(DatabaseQuery.java:147)
    at com.aztecsoft.quality.ProjectTrackerUtil.getNetworkDays(ProjectTrackerUtil.java:73)
    at com.aztecsoft.quality.ProjectPlan.calODurationinDays(ProjectPlan.java:81)
    at com.aztecsoft.quality.ProjectPlan.projectSummary(ProjectPlan.java:25)
    at com.aztecsoft.quality.ProjectPlan.main(ProjectPlan.java:126)
    Thanks in advance.

    Hi this is gopi,Hyd.Is your Problem "Getting "Error Establishing Socket " error while running the application" solved if so can you reply me i am waiting for this answer

Maybe you are looking for

  • Barcodes are not printing

    Hi, We have a printronix printer model Printronix T5304 with the device type added LB_PRI. The requirement is Barcode printing and i have added the 2 Barcodes ZUCC_LA ZUCC_SP to this device type but still the Barcodes are not printing. Can you sugges

  • Pixel offsetting in Images

    Although I use clean images at 72 dpi and import as PNG files, no compression, no smoothing, Properties=lossless PNG... the outputted swf file sometimes shows offset areas... e.g. parts of letters are sometimes offset. I noticed that it happens horiz

  • Error: GadgetMsgs.xml could not be processed

    I am having trouble with several asp gadgets failing to load the GadgetMsgs.xml file. The error I receive is: ERROR in ReadMsgs: This Gadget uses resource file D:\Inetpub\wwwroot\cp-community\EN\GadgetMsgs.xml, but the file could not be processed. Pl

  • How do I transfer or download Pages which was on my previous laptop?

    How do I transfer or download Pages which was on my previous laptop? I can see it in iCloud but do not know how to download to my new laptop. Thank You

  • Icon thumb nails

    Can someone explain why sometimes the icon thumbnail picture shows up on some icons and not others. When I move pictures from one folder to another or when I drag a photo from the iphoto window to the desktop, some icons show the thumbnail of the pic