com.microsoft cannot be resolved to a type

Hi all:

I recently changed to a new PC and thus new eclipse installation. Now if I open my files with eclipse, there are error markings wherever I have:
new com.microsoft.jdbc.sqlserver.SQLServerDriver()

The words: "com.microsoft" got underlined
The error message is: "com.microsoft cannot be resolved to a type"

What do I do to resolve this? Thanks.
sdc248Asked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
You need to add the SQL Server driver jar to your build path
0
 
olgavillamizarCommented:
you have to put into path the .jar (driver sql)
In eclipse you have to rigth click in the proyect and then properties/java build path/libraries and then you select the jar
0
 
objectsCommented:
> new com.microsoft.jdbc.sqlserver.SQLServerDriver()

that should be:

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");

Then you won't get a compile error

to run it you actually need more than one jar

you can download the jars here
http://www.microsoft.com/downloads/details.aspx?FamilyID=07287b11-0502-461a-b138-2aa54bfdc03a&DisplayLang=en

0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
sdc248Author Commented:
problem solved. Thanks.
0
 
sdc248Author Commented:
My old jars were located on C: of the old machine, thus the problem....
0
 
CEHJCommented:
:-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.