Showing posts with label java. Show all posts
Showing posts with label java. 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

Friday, March 23, 2012

How To Connect Sql Server 2000 From Java

Hi,

How do I Connect Sql Server 2000 to Java

Quote:

Originally Posted by subhendu123

Hi,

How do I Connect Sql Server 2000 to Java


Java connects to databases using JDBC. You just need an appropriate driver for the connecton to work.|||

Quote:

Originally Posted by r035198x

Java connects to databases using JDBC. You just need an appropriate driver for the connecton to work.


1. download the jar file from microsoft ; msutil.jar, mssqlsever.jar, msbase.jar
2. Setting the CLASSPATH: C:/..lib/msutil.jar,.../mssqlserver.jar;.../msbase.jar
3. Enable TCP/IP
4. the default port no usually 1433.
5. Stop Firewall|||

Quote:

Originally Posted by nurmaiza

1. download the jar file from microsoft ; msutil.jar, mssqlsever.jar, msbase.jar
2. Setting the CLASSPATH: C:/..lib/msutil.jar,.../mssqlserver.jar;.../msbase.jar
3. Enable TCP/IP
4. the default port no usually 1433.
5. Stop Firewall


So far, I have not seen any updates on how to access sql server using Windows Authentication. I don't think it can. There's a (used to be free) softwware that says they can: http://www.datadirect.com/products/jdbc/comparing_with_microsoft/index.ssp|||

Quote:

Originally Posted by subhendu123

Hi,

How do I Connect Sql Server 2000 to Java


i found this:
http://jtds.sourceforge.net/index.html|||

Quote:

Originally Posted by ck9663

i found this:
http://jtds.sourceforge.net/index.html


And you can get the connection strings from
www.connectionstrings.com