Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.PreparedStatement;
- import java.sql.ResultSet;
- import java.sql.SQLException;
- import java.sql.Statement;
- public class TryThree {
- public static void main(String args[]) throws SQLException{
- Connection con = DriverManager.getConnection ("jdbc:mysql://67.20.123.248:3306/whitebu4_sliditerod" ,"whitebu4_admins" , "admins1234");
- String dbClass = "com.mysql.jdbc.Driver";
- Statement statement = con.createStatement();
- String query = "Select x,y,z FROM xyz";
- ResultSet result = statement.executeQuery(query);
- result.getFloat ("Nome");
- result.getFloat ("Nome");
- result.getFloat ("Nome");
- result.getString ("Nome");
- try {
- Class.forName("com.mysql.jdbc.Driver");
- Statement st = con.createStatement();
- while(result.next()){
- System.out.print(result);
- System.out.print(result);
- System.out.print(result);
- } //end while
- con.close();
- } //end try
- catch(ClassNotFoundException e) {
- e.printStackTrace();
- }
- catch(SQLException e) {
- e.printStackTrace();
- }
- } //end main
- } //end class
Add Comment
Please, Sign In to add comment