Link to home
Start Free TrialLog in
Avatar of Brian Sandt
Brian Sandt

asked on

Getting error trying to connect to SQL Server using java

Trying to connect to a SQL Server database from our internal web portal.
This is what I'm getting:
An error occurred at line: 1,694 in the jsp file: /accountDetail.jsp
DriverManager cannot be resolved
1691: Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
1692:
1693: String connectionUrl = "jdbc:sqlserver://HNCIISDEV;" + "databaseName=WebPortal;user=" + login + ";password=" + pass;
1694: con = DriverManager.getConnection(connectionUrl);
1695: }
1696: catch(ClassNotFoundException cnfex)
1697: {

Any ideas what my developer is missing?
ASKER CERTIFIED SOLUTION
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nakul Vachhrajani
It looks like your environment does not have the JDBC driver for SQL Server installed. Can you please try installing it? https://msdn.microsoft.com/en-us/library/mt484311(v=sql.110).aspx
Avatar of Brian Sandt
Brian Sandt

ASKER

The JDBC driver was installed.  

Sending my developer the link for the connection string.
Developer was finally able to get it working.