*
The moose likes JDBC and the fly likes [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing " Watch "[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing " New topic
Author

[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing

A. S. Georgie
Ranch Hand

Joined: Dec 25, 2009
Posts: 72
Hello,

First of all, clearly this unsatisfaction is occuring to me when using driver.jar, and not when i Data Source (ODBC).

I'm trying a sample jboss_test from www.datadirect.com, that is a simple jsp trying to connect a Database Server,
and no matter about the database, just some information about this connectivity (e.g. information about driver, database name, ... ), then i don't need a database to create, my bald problem is that when i try to run and call jsp of foregoing things from this Url 'http://localhost:8080/JBossTestWeb/JBossTest.jsp' i'm getting some error insisting Error establishing socket; for your information, i surfed around alot about this error and did what required without a hint of success, though i checked the firewall registry to verify ports, above all this, tried at least 6 different driver to get a different shadow, then i guess that Jboss recognizing proper driver, say,
1. SQL Server 2000: 'jtds-0.9.jar', ('msbase.jar' + 'mssqlserver.jar' + 'msutil.jar'), 'sqlserver.jar'
2. 'mysql-connector-java-3.0.8.jar', and for mysql: 'mysql.jar', 'mm.mysql-2.0.8-bin.jar' - that my

see how'm getting result when try this ('msbase.jar' + 'mssqlserver.jar' + 'msutil.jar') sql server 2000 for sql server 2000 through JBoss, my mssql-ds.xml is like:

  • <?xml version="1.0" encoding="UTF-8"?>

    <datasources>
    <local-tx-datasource>
    <jndi-name>ds/TestDS</jndi-name>
    <connection-url>jdbc:microsoft:sqlserver://localhost:1433</connection-url>
    <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
    <user-name>Solar</user-name>
    <password>Sun</password>
    <connection-property name="sendStringParametersAsUnicode">false</connection-property>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>100</max-pool-size>
    <blocking-timeout-millis>5000</blocking-timeout-millis>
    <idle-timeout-minutes>15</idle-timeout-minutes>
    </local-tx-datasource>
    </datasources>



  • with this error:

    ERROR: org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.))
    Nested Exception: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.)
    Nested Exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.

    trying other driver gives me the same for example trying sqlserver.jar from www.datadirect.com gives me:

    datadirect-ds.xml is like:


  • <?xml version="1.0" encoding="UTF-8"?>

    <datasources>
    <local-tx-datasource>
    <jndi-name>ds/TestDS</jndi-name>
    <connection-url>jdbc:datadirect:sqlserver://localhost:1433</connection-url>
    <driver-class>com.ddtek.jdbc.sqlserver.SQLServerDriver</driver-class>
    <user-name>test</user-name>
    <password>secret</password>
    <connection-property name="sendStringParametersAsUnicode">false</connection-property>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>100</max-pool-size>
    <blocking-timeout-millis>5000</blocking-timeout-millis>
    <idle-timeout-minutes>15</idle-timeout-minutes>
    </local-tx-datasource>
    </datasources>



  • ERROR: org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLNonTransientConnectionException: [DataDirect][SQLServer JDBC Driver]Error establishing socket to host and port: localhost:1433. Reason: Connection refused: connect); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLNonTransientConnectionException: [DataDirect][SQLServer JDBC Driver]Error establishing socket to host and port: localhost:1433. Reason: Connection refused: connect))
    Nested Exception: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLNonTransientConnectionException: [DataDirect][SQLServer JDBC Driver]Error establishing socket to host and port: localhost:1433. Reason: Connection refused: connect)
    Nested Exception: java.sql.SQLNonTransientConnectionException: [DataDirect][SQLServer JDBC Driver]Error establishing socket to host and port: localhost:1433. Reason: Connection refused: connect

    I checked Windows Security Center > Windows Firewall on Exception i entered SQL Server with port 1433, ... also i need to say that my computer name is (Systems > Computer Names > Computer Name Changes): POPILLON the same, my sql server 2000 is running POPILLON, if these information needed,


    great appreciation
    A. S. Georgie
    Ranch Hand

    Joined: Dec 25, 2009
    Posts: 72
    Attached ...


    [Thumbnail for POPILLON.JPG]

    Paul Sturrock
    Bartender

    Joined: Apr 14, 2004
    Posts: 10336

  • Are you using the correct credentials?
  • If so, does your SQL Server instance support TCP/IP? SQL Server 2000 should have this turen on by default, but you may have turned it off.
  • Is your server configured to allow SQL Server authentication? By default, SQL Server uses only Windows integrated authentication.


  • (NB: you seem to be using very old versions of various JDBC drivers. Not likely to be the cause of the issue, but asking for trouble long term.)


    JavaRanch FAQ HowToAskQuestionsOnJavaRanch
    A. S. Georgie
    Ranch Hand

    Joined: Dec 25, 2009
    Posts: 72
    Paul Sturrock wrote:
  • Are you using the correct credentials?


  • dearir, by credentials i cannot understand what you mean ...


    Paul Sturrock wrote:
  • If so, does your SQL Server instance support TCP/IP? SQL Server 2000 should have this turen on by default, but you may have turned it off.


  • for this part, if this is true that already i used Data Sources (ODBC) many times, so is this means that TCP/IP has not turned off? and i just having problems with connecting driver ....

    Paul Sturrock wrote:
  • Is your server configured to allow SQL Server authentication? By default, SQL Server uses only Windows integrated authentication.


  • this is the part i must say i didn't now at all how to configure this, is your mean jboss-3.2.5\server\default\conf\login-config.xml? if so, how can i do then for SQL Server 2000...

    Paul Sturrock wrote:
    (NB: you seem to be using very old versions of various JDBC drivers. Not likely to be the cause of the issue, but asking for trouble long term.)

    here yes, but generally no i must add, and when i used others 'm having same results ....

    best regards.

    A. S. Georgie
    Ranch Hand

    Joined: Dec 25, 2009
    Posts: 72
    Paul Sturrock wrote:
  • Are you using the correct credentials?



  • Oh yes, that i checked those million times , but it seems to me that JBoss recognized them (drivers) but it's problem in exactly to connect to servers?

    how i guess 'bout this is that using different drivers getting different messages that related to that server (e.g. consider that sql server 2000 drivers and the message)
    Paul Sturrock
    Bartender

    Joined: Apr 14, 2004
    Posts: 10336


    for this part, if this is true that already i used Data Sources (ODBC) many times, so is this means that TCP/IP has not turned off? and i just having problems with connecting driver ....

    I doubt ODBC will use TCP/IP - not 100% sure, but I would check anyway.


    this is the part i must say i didn't now at all how to configure this, is your mean jboss-3.2.5\server\default\conf\login-config.xml? if so, how can i do then for SQL Server 2000...

    This is nothing to do with JBoss, its your SQL server instance that I am talking about. Check the properties of your database server, specifically if it allows SQL Server authentication.

    A. S. Georgie
    Ranch Hand

    Joined: Dec 25, 2009
    Posts: 72
    Paul Sturrock wrote:
    This is nothing to do with JBoss, its your SQL server instance that I am talking about. Check the properties of your database server, specifically if it allows SQL Server authentication.


    i ran svrnetcn command, if so, attached show the situation ...


    [Thumbnail for svrnetcn.JPG]

    Paul Sturrock
    Bartender

    Joined: Apr 14, 2004
    Posts: 10336

    That looks OK. There was an issue with very early versions of the networking dll - if your SQL Server instance is unpatched there may still be an issue, but I think that looks OK.

    So all thats left is if your SQL Server instance is configured to allow SQL Server authentication (like I said early, by default it is not).
    A. S. Georgie
    Ranch Hand

    Joined: Dec 25, 2009
    Posts: 72
    Paul Sturrock wrote:
    That looks OK. There was an issue with very early versions of the networking dll - if your SQL Server instance is unpatched there may still be an issue, but I think that looks OK.

    dear Paul, sorry but, i'm very new fresh computer programmer if i can call it, what i have to do now, i'm loosing my power with these all disconnection, how to find this networking dll? how patch my SQL Server? these all are very important to me in a clear way


    Paul Sturrock wrote:
    So all thats left is if your SQL Server instance is configured to allow SQL Server authentication (like I said early, by default it is not).

    so please lemme do this configuration step by step,

    very thank you Paul
    Paul Sturrock
    Bartender

    Joined: Apr 14, 2004
    Posts: 10336


    dear Paul, sorry but, i'm very new fresh computer programmer if i can call it, what i have to do now, i'm loosing my power with these all disconnection, how to find this networking dll? how patch my SQL Server? these all are very important to me in a clear way

    This is a long shot. Its far more likely your server is not configured to support SQL Server authentication, since this is the default setting for SQL Server. Just right click on your server in management studio and see what the version number is.


    so please lemme do this configuration step by step,

    Afraid I can't remeber off the top of my head for SQL Server 2000. You probably want to start by looking at the properties of the server (as mentioned above) and see if you can find the security settings from there. If you don't want to guess your way around, this is all covered in the SQL Server documentation on MDSN.
    A. S. Georgie
    Ranch Hand

    Joined: Dec 25, 2009
    Posts: 72
    Paul Sturrock wrote:
    This is a long shot. Its far more likely your server is not configured to support SQL Server authentication, since this is the default setting for SQL Server. Just right click on your server in management studio and see what the version number is.

    version 8.0 got there (attached)...

    Paul Sturrock wrote:
    Afraid I can't remeber off the top of my head for SQL Server 2000. You probably want to start by looking at the properties of the server (as mentioned above) and see if you can find the security settings from there. If you don't want to guess your way around, this is all covered in the SQL Server documentation on MDSN.

    with SQL Server i don't know how, but for windows right this way i did it off 'fire wall' having this problem too.
    A. S. Georgie
    Ranch Hand

    Joined: Dec 25, 2009
    Posts: 72
    i see forward looking for some guide and its greatly appreciated, a sparkling hint that put me on the track ...
    Paul Sturrock
    Bartender

    Joined: Apr 14, 2004
    Posts: 10336

    What you've got is the version of enterprise manager (which is a sql client), not the SQL Server server instance. Like I said, that suggestion is very much a long shot. You would need to have a very old version of SQL Server 2000 for it to be a problem (the only time I've seen it the tcp/ip DLLs were dated 1998).

    As I've said a few times now, the more likely source is your SQL Server is not configured to allow SQL Server authentication, since this is the default. Try looking at the properties of the server. If you are not sure how to do that, MSDN includes product documentation - I'm sorry I can't remember (SQL Server 2000 is a good few years past being a supported platform).

    A. S. Georgie
    Ranch Hand

    Joined: Dec 25, 2009
    Posts: 72
    and this is the result in Jboss, when you try jtds-0.9.jar driver and xml like:

    <connection-url>
    jdbc:jtds:sqlserver://localhost:1433
    </connection-url>
    <driver-class>
    net.sourceforge.jtds.jdbc.Driver
    </driver-class>
    A. S. Georgie
    Ranch Hand

    Joined: Dec 25, 2009
    Posts: 72
    Jboss


    [Thumbnail for Jboss.JPG]

    A. S. Georgie
    Ranch Hand

    Joined: Dec 25, 2009
    Posts: 72
    Paul Sturrock wrote:What you've got is the version of enterprise manager (which is a sql client), not the SQL Server server instance. Like I said, that suggestion is very much a long shot. You would need to have a very old version of SQL Server 2000 for it to be a problem (the only time I've seen it the tcp/ip DLLs were dated 1998).

    As I've said a few times now, the more likely source is your SQL Server is not configured to allow SQL Server authentication, since this is the default. Try looking at the properties of the server. If you are not sure how to do that, MSDN includes product documentation - I'm sorry I can't remember (SQL Server 2000 is a good few years past being a supported platform).



    Oh man, anyway i forgot about everything i guess to thank you, best best wishes ...
     
     
    subject: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing
     
    Similar Threads
    How to make a data source connection without writing a User name & Password and the -ds.xml file
    jboss cmp sql server 2000
    JDBC Connection??
    Problem oin connecting Oracle database in JBOSS AS 4.2.3
    Unable to obtain datasource