Welcome to the SQL Server JDBC blog

Welcome to the SQL Server JDBC blog

  • Comments 77

Unsure of what to specify in the connection URL? Having trouble configuring the driver for Integrated Authentication? Confused about some behavior with the Microsoft SQL Server JDBC driver? Then, this is the blog site for you.

The SQL Server JDBC team maintains this blog.  The team is responsible for all things regarding JDBC with SQL Server.  We hope to use this blog to proactively provide answers to many of the re-occuring issues that we see our customers face.  We will also use this blog to provide some insight into features in planning for future releases.

Hopefully you will find this useful.

SQL Server JDBC team
Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights

Leave a Comment
  • Please add 5 and 6 and type the answer here:
  • Post
  • I am trying to connect eclipse (MyEclipse) to sqlserver 2008.

    Where can I get the connection URL information?

    Thanks

  • Hey Mark,

    We have a documentation that should help you with this:

    http://msdn.microsoft.com/en-us/library/ms378672.aspx

    --Tres London [SQL Server]

  • Hi,

    I am using Pentaho right now installed to a local computer and would want to create a data source that connects to a remote MS SQL server but I can't. I always get this error:

    "Connection attempt failed: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'admin'. "

    I am using the following:

    driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"

    url="jdbc:sqlserver://s02-db01;databaseName=scorecard"

    Admin user is already an administrator both in the local computer and in the server.

    I am not an expert in java so I am not sure on how to resolve this. Please help.

    Thanks for all the help.

  • Hi,

    I am using Pentaho right now installed to a local computer and would want to create a data source that connects to a remote MS SQL server but I can't. I always get this error:

    "Connection attempt failed: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'admin'. "

    I am using the following:

    driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"

    url="jdbc:sqlserver://s02-db01;databaseName=scorecard"

    Admin user is already an administrator both in the local computer and in the server.

    I am not an expert in java so I am not sure on how to resolve this. Please help.

    Thanks for all the help.

  • Hi,

    I am using Pentaho right now installed to a local computer and would want to create a data source that connects to a remote MS SQL server but I can't. I always get this error:

    "Connection attempt failed: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'admin'. "

    I am using the following:

    driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"

    url="jdbc:sqlserver://s02-db01;databaseName=scorecard"

    Admin user is already an administrator both in the local computer and in the server.

    I am not an expert in java so I am not sure on how to resolve this. Please help.

    Thanks for all the help.

  • Is the admin user the same user in the remote machine and the local machine? Have you tried using our 2005 driver?

  • Yep. they're the same user. I haven't tried the 2005 driver. The MS SQL Server I am connecting to is 2000 SP3.

    I'm guessing the problem could be in the security network - it might be blocking my connection but I don't know how to check this further. =(

  • Hey Harry,

    Connectivity issues can be a tough nut to crack. However, if you'd just like to verify whether you're even getting through to your server that should be pretty easy. Just download and install (on your server) our free Netmond Parser:

    http://www.microsoft.com/downloads/details.aspx?familyid=f4db40af-1e08-4a21-a26b-ec2f4dc4190d&displaylang=en

    The protocol SQL Server uses to send data across the wire is TDS. By default Netmon uses a stub parser that won't reveal any information about TDS. However, it does have a fully functioning TDS parser included, you just have to enable.

    So, have the parser listen for traffic and then initiate your client request. If you see that request come through then you know that your request are at least hitting the server. It could still mean you're having connectivity problems, they just might lie on your server. In any event, a good place to read about troubleshooting connectivity:

    http://blogs.msdn.com/sql_protocols/archive/2008/04/30/steps-to-troubleshoot-connectivity-issues.aspx

    If you need real support I would recommend you open up a CSS case:

    http://support.microsoft.com/ph/2852

    You could also try and apply SP4 and see if that makes a difference.

  • it took me ages to resolve this!

    but glad i did. my SQL Server 2000 authentication mode is set to Windows Authentication mode. JDBC Driver does not support Windows NT authentication so instead, I set authentication mode to Mixed Mode and used the sa account.

  • Hi,

    i'm using JDBC to connect to SQL Server 2005 locally using integrated security. it's getting failed with the following error code

    Error: 17806, Severity: 20, State: 2.

    Logon       SSPI handshake failed with error code 0x8009030c while establishing a connection with integrated security; the connection has been closed. [CLIENT: 127.0.0.1]

    Logon       Error: 18452, Severity: 14, State: 1.

    Logon       Login failed for user ''. The user is not associated with a trusted SQL Server connection. [CLIENT: 127.0.0.1]

    But i'm able to coneect successfully using 127.0.0.1. the connection is failing only when i give localhost.

    Connection URL:

    jdbc:sqlserver://LOCALHOST:1433;DatabaseName=master;integratedSecurity=true

  • We need little more information on this, this blog post can help you in determining the root cause of this issue

    http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx

  • mi consulta es la siguiente:

    estoy utilizando el jdbc 1.2 para sql server 2005, junto con JPA de toplink con procedimientos almacenados

    pero me da la siguiente excepcion:

    Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: La instrucción no devolvió un conjunto de resultados.

    esta excepcion solo me da en procedimientos que utilizan como parametros los tipo de datos fecha.

    alguien sabe cual puede ser mi falla?. muchas gracias

  • Hi, I'm trying to make a java application that connects to an SQL database (2008 Express).

    [code] Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    con = DriverManager.getConnection("jdbc:odbc:OnlineTutorials");

    [/code]

    This returns this error:

    [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

    What's wrong?

    Thanks!

  • Did you make sure that the onlineTutorials datasource is registered via the odbc administrator. Also, the preferred way to access sqlserver is via our driver not the jdbc odbc bridge.

    http://msdn.microsoft.com/en-us/library/ms378526.aspx

  • Hi

    I am trying to connect to SQL2008 express edition server from our application and it works fine when I used sqljdbc.jar and jre1.5. But when I used JRE1.6 and sqljdbc4.jar or sqljdbc.jar, I am getting the following error. I have used out of the box configuration and SSL is not enabled

    ===

    com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SQL Server returned an incomplete response. The connection has been closed."."

    ==

    Here are the details:

    Driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver

    URL:

    jdbc:sqlserver://localhost:1433;databaseName=master;

    I am able to connect to the same server instance using jTDS driver using jre1.6 and it works fine. So, it seems like some issue with combincation of jdbc2.0 driver and JRE1.6. I have tried to google, but could not find a solution. Any pointers on how to resolve this.

    Thank you in advance.

Page 4 of 6 (77 items) «23456