Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/myuser", "root", "root"); // please replace localhost and 3306 with IP and port of your database
  2. String sql = "select * from yourtable"; // your query
  3. Statement st = (Statement)conn.createStatement();
  4. st.executeQuery(sql);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement