Link to home
Start Free TrialLog in
Avatar of sdc248
sdc248Flag for United States of America

asked on

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.
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of olgavillamizar
olgavillamizar

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
> 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

Avatar of sdc248

ASKER

problem solved. Thanks.
Avatar of sdc248

ASKER

My old jars were located on C: of the old machine, thus the problem....
:-)