Dead_Jester
Dead_Jester

Reputation: 602

Working with SQL Server Database in Java

My company has a large SQL Server database that was created and maintained with Microsoft SQL Server 2008. I am new to working with SQL Server on a large scale like this. I want to be able to automate some of the common maintenance operations that we do and I want to do so using Java.

My question is this: How do I use a Java application to execute SQL statements on our database? I also would like to be able to use this application to create a small test database so that I can test some of the functions on a small scale before I use them on the live database.

I have been doing some reading online and found information on using JDBC to create the connection with the database and then use a connection object with a statement object to execute a statement. The problem is that this requires drivers and I cant seem to pin down with driver will do what i need it to do. Is there an easier way to do this? If not, where can I find a driver that will do what I need it to do.

Thank you for your help!

Upvotes: 0

Views: 167

Answers (1)

zrac
zrac

Reputation: 153

You may use JDBC. If you use Maven you could simply add the artifact "sqljdbc4".

The JDBC driver: http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774

A JDBC tutorial: http://www.amazon.com/JDBC¿-API-Tutorial-Reference-Edition/dp/0321173848

Upvotes: 1

Related Questions