I am trying to create a calss with a constructior that creates connection with MYSql database , i am using database name as dbetch . I have set the path varable but still it id throwing error
package login;
import java.sql.*;
import java.sql.DriverManager;
import com.mysql.jdbc.Connection;
public class conn {
Connection con=null;
ResultSet rs=null;
Statement st=null;
public conn() {
Class.forName("com.mysql.jdbc.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost/dbetech","root","");
}
}
Error thrown
D:\etech\WEB-INF\src>javac *.java
conn.java:18: incompatible types
found : java.sql.Connection
required: com.mysql.jdbc.Connection
con=DriverManager.getConnection("jdbc:mysql:///dbetech","root","");
1 error