Hi, i am trying to access a database from my servlet using Forte and the tomcat server. My servlet works fine but when i try to access the database it does not seem to be able to see it. The top part of my code is below
I placed the database access code in a static block rather than the init method but still get the same error. My errors are Error loading driver: java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver and Error connecting to database: java.sql.SQLException: No suitable driver. Im new to this malarky and so not sure if i have any glaring errors that may be preventing it from working. Thanks Sam
Sam Tilley SCJP, SCWCD
posted 14 years ago
Sam It can't find your driver for the database. Make sure that the package com.microsoft.jdbc.sqlserver.SQLServerDriver is in your class path.