Type Mismatch: Cannot convert from Connection to Connection

import java.sql.DriverManager;

publicclass Connection{

publicstatic Connection getDatabaseConnection(){

Connection con =null;

try{

// load the driver

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

// get the connection

con = DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:bob","scott","tiger");

if(con !=null){

System.out.println("Connection established Successfully at port : "+1521);

}else{

System.out.println("Could not establish Connection");

}

}

catch (Exception e){

e.printStackTrace();

con =null;

}

return con;

}

}

Error pointing on line

con = DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:bob", "scott", "tiger");

Type Mismatch: Cannot convert from Connection to Connection

I have included the classes12.jar file as an external Jar file for the project.

[1958 byte] By [hemanthjavaa] at [2007-11-27 10:34:24]
# 1

Yeah well you managed to confuse the hell out of the compiler by creating a class called Connection. So the compiler doesn't know if you want a java.sql.Connection or your Connection.

There are a few ways to fix this but why don't you just go the easy route and rename your class to something less confusing?

cotton.ma at 2007-7-28 18:28:36 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...