Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- class Mysqll{
- public static void main(String args[]){
- try{
- Class.forName("com.mysql.jdbc.Driver");
- Connection con = DriverManager.getConnection("jdbc::mysql://localhost:3306/asd","root","qwerty");
- Statement st = con.createStatement();
- ResultSet rs = st.executeQuery("select * from abc");
- while(rs.next())
- {
- System.out.println(rs.getInt(1) + " " + rs.getString(2));
- }
- con.close();
- }
- catch(Exception e)
- {
- System.out.println(e);
- }
- }
- }
- java.sql.SQLException: No suitable driver found for jdbc::mysql://localhost:3306/asd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement