Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.*;
- String driver = "com.mysql.jdbc.Driver"; // MySql driver
- Class.forName(driver);
- Connection con=DriverManager.getConnection("jdbc:mysql://localhost/test","root","pass");
- ResultSet result = null;
- String query = "SELECT * FROM client";
- try {
- Statement stmt = con.createStatement();
- result = stmt.executeQuery(query);
- } catch (SQLException e) {
- //if exception is throwe
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement