problem in connecting to database
hi ,
I tried to load the driver for SQL SERVER I downloaded from their site.
In the help file they specificly said that its name is "com.microsoft.jdbc.sqlserver.SQLServerDriver ".
I also made sure that the CLASSPATH is set correctly ,
but unfortunatally I couldnt compile the next application
class Test {
public static void main(String[] args){
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
}
}
does someone know what have I done wrong?
thanks ahead
Eran
This won't fix your problem, but it will give more info:
public class Test
{
public static void main(String[] args)
{
try
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
I'm betting that you THINK you set CLASSPATH properly, but you did not.
%
you can use any driver i give a hint
this driver come under jdk
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
you check driver is properly installed or not following code to try
try
{
Class.forName("any driver")
}
catch(ClassNotFoundException e)
{
System.out.println("driver is not installed properly+e")}