class Connection not found, variable DriverManager not found.
Hi all,
I'm having a bit of trouble just setting up a basic connection to Microsoft SQL Server. I've followed every tutorial, and despite how easy it looks, my code just does not want to compile. Here is what I have (it doesn't do anything other than establish a connection):
import javax.sql.*;
import java.io.*;
import javax.naming.*;
public class JDBCtest
{
public static void main (String [] args)
{
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
String url = "jdbc:microsoft:sqlserver://ye";
Connection con = DriverManager.getConnection(url);
}
}
The error messages i'm getting are:
JDBCtest.java:13: cannot find symbol
symbol : class Connection
location: class JDBCtest
Connection con = DriverManager.getConnection(url);
^
JDBCtest.java:13: cannot find symbol
symbol : variable DriverManager
location: class JDBCtest
Connection con = DriverManager.getConnection(url);
All this leads me to believe that I haven't properly importted all the classes I need. In my experience with Java, the solution will be really easy, but I just can't seem to figure it out!
Can anyone give me a hand?
Regards,
Jack Smith

