Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final String USER = "root";
- final String PASS = "1012";
- Connection conn = null;
- Statement stmt = null;
- try{
- //STEP 2: Register JDBC driver
- Class.forName("com.mysql.cj.jdbc.Driver");
- //STEP 3: Open a connection
- System.out.println("Connecting to database...");
- conn = DriverManager.getConnection(DB_URL,USER,PASS);
- //STEP 4: Execute a query
- System.out.println("Creating statement...");
- stmt = conn.createStatement();
- String sql;
- sql = "SELECT * FROM tb_usuario where login_usuario ='" + login_informado + "' and senha_usuario='" + password_informado + "'";
- ResultSet rs = stmt.executeQuery(sql);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement