Showing posts with label driver. Show all posts
Showing posts with label driver. Show all posts

Wednesday, March 28, 2012

How to connect to sql server2005 from java using JDBC driver

Hi, everyone:
I need to connect my java app to sql server 2005 using JDBC driver, but I don't know how to do.
Thanks for your help.
AdolfoWe currently have a beta2 driver availalbe for this now:

http://www.microsoft.com/sql/downloads/2005/jdbc.mspx

To connect:

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection conn = DriverManager.getConnection("jdbc:sqlserver://mysqlserver;user=myuser;password=mypassword;databaseName=mydataBase;");

|||

Ok. happen that I have installed the sqlserver 2005 beta 2, using windows authentication, so it needs a name instance to get access. When I use the JDBC driver I can't connect using that name instance.

regards,

Adolfo

|||The beta version of windows authentication has some known issues -- did you try connection to the named instance with SQL Server authentication?

-shelby

How to connect to sql server2005 from java using JDBC driver

Hi, everyone:
I need to connect my java app to sql server 2005 using JDBC driver, but I don't know how to do.
Thanks for your help.
AdolfoWe currently have a beta2 driver availalbe for this now:

http://www.microsoft.com/sql/downloads/2005/jdbc.mspx

To connect:

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection conn = DriverManager.getConnection("jdbc:sqlserver://mysqlserver;user=myuser;password=mypassword;databaseName=mydataBase;");|||

Ok. happen that I have installed the sqlserver 2005 beta 2, using windows authentication, so it needs a name instance to get access. When I use the JDBC driver I can't connect using that name instance.

regards,

Adolfo

|||The beta version of windows authentication has some known issues -- did you try connection to the named instance with SQL Server authentication?

-shelby

Monday, March 12, 2012

How to configure distributed transaction / XA support using Microsoft SQL Server 2005 JDBC Drive


I am trying to configure distributed transaction and XA support using Microsoft SQL Server 2005 JDBC Driver. I have coppied SQLJDBC_XA.dll from XA directory and placed in my sql server binn directory and trying to run the script xa_install.sql from binn directory with command as below :

C:\Program Files\Microsoft SQL Server\80\Tools\Binn>
osql -U sa -n -P admin -S localhost -i C:\JavaLibraries\MS SQL Driver\sqljdbc_1.2\enu\xa\ xa_install.sql

But I am getting error saying :
[DBNETLIB]SQL Server does not exist or access denied.
[DBNETLIB]ConnectionOpen (Connect()).

when I replaced local host with the machine name it gives error :
[Shared Memory]SQL Server does not exist or access denied.
[Shared Memory]ConnectionOpen (Connect()).

where in I am able to test connection from Websphere using the same connection.

Please help some one ....... I am in URGENT need.... I need to enable XA suport for my application to run........

Thanks -
This looks like a connectivity issue. Do you have this problem only with osql? Can you connect using Query analyzer?|||

I was able to install the SQLJDCB_XA.dll with the exception that I copied it into a different directory:

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn

Have you tried that?

Regards.

How to configure distributed transaction / XA support using Microsoft SQL Server 2005 JDBC Drive


I am trying to configure distributed transaction and XA support using Microsoft SQL Server 2005 JDBC Driver. I have coppied SQLJDBC_XA.dll from XA directory and placed in my sql server binn directory and trying to run the script xa_install.sql from binn directory with command as below :

C:\Program Files\Microsoft SQL Server\80\Tools\Binn>
osql -U sa -n -P admin -S localhost -i C:\JavaLibraries\MS SQL Driver\sqljdbc_1.2\enu\xa\ xa_install.sql

But I am getting error saying :
[DBNETLIB]SQL Server does not exist or access denied.
[DBNETLIB]ConnectionOpen (Connect()).

when I replaced local host with the machine name it gives error :
[Shared Memory]SQL Server does not exist or access denied.
[Shared Memory]ConnectionOpen (Connect()).

where in I am able to test connection from Websphere using the same connection.

Please help some one ....... I am in URGENT need.... I need to enable XA suport for my application to run........

Thanks -
This looks like a connectivity issue. Do you have this problem only with osql? Can you connect using Query analyzer?|||

I was able to install the SQLJDCB_XA.dll with the exception that I copied it into a different directory:

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn

Have you tried that?

Regards.