Code example for PreparedStatement

Methods: executeQuerysetStringclose

0
			 
			// create a statement 
			pstmt = conn.prepareStatement(query); 
			 
			//set input parameter 
			pstmt.setString(1, name);
			pstmt.setString(2, password);
			 
			rs = pstmt.executeQuery();
			// extract data from the ResultSet 
			 
			if(rs.next()) {
				if(rs.getInt(1)>0) isRegistered = true;
			} 
 
		} catch (Exception e) {
			e.printStackTrace();
		} finally { 
			try { 
				rs.close();
				pstmt.close();
				conn.close();
			} catch (SQLException e) {
				e.printStackTrace();
			} 
		} 
Connect your IDE to all the code out there  Get Codota for Java