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

[1300 byte] By [smithj04a] at [2007-10-2 7:53:20]
# 1
import java.sql.*NOT javax.sql.*There is such a package as javax.sql but it is an extension for more advanced stuff. The basics (Connection, DriverManager etc) are all to be found in the java.sql package.
smithj04a at 2007-7-16 21:41:59 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
Thanks :DI knew it would be something simple!
smithj04a at 2007-7-16 21:41:59 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...