Connecting SQL SERVER 2008 with TOMCAT 7

User Generated

znqql09

Programming

Question Description

Hello everyone
I am stuck with a new problem.I want to use SQL SERVER 2008 as the database in my Servlet project but don't know how to configure it.Any type for connection may be useful either by a datasource or by Sql Server Driver .
knodly help !!!!

Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool's honor code & terms of service.

Explanation & Answer

you can use JDBC connection

String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
Class.forName(driver);
String url = "jdbc:microsoft:sqlserver://host:1433/database";
Connection conn = DriverManager.getConnection(url, "username", "password");

fngvfupuraahcngv (7)
UT Austin

Anonymous
Great content here. Definitely a returning customer.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4