I want to connect Presto DB by JDBC.
String sql="Select * from mysql.infsci2711toturial.Person";
String url="jdbc:presto://localhost:8080/catalog";//Under catalog folder, there is my mysql.properties file.
Connection connection=null;
try{
connection=DriverManager.getConnection(url, "root", null);
Statement stmt=connection.createStatement();
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()){
System.out.println(rs.getString(1));
}
}catch(SQLException ex){
System.out.println(Arrays.toString(((URLClassLoader) ClassLoader.getSystemClassLoader()).getURLs()));
ex.printStackTrace();
System.out.println("wrong connection!");
}
The problem show in eclipse is that: No suitable driver found for jdbc:presto://localhost:8080/catalog I have tried to put presto-jdbc-0.93.jar under WEB-INF/lib. But don't solve this problem. How to solve this problem. Do I need set Maven? and how?