Code example for PreparedStatement

Methods: executeUpdatesetObjectclose

0
				Connection c = AccesBDD.getInstance();
 
				String requete ="INSERT INTO correspondanteleve (idcorrespondant, ideleve) VALUES (?, ?)";
 
				PreparedStatement ps = c.prepareStatement(requete);
				ps.setObject(1, dtoCorrespondantEleve.getIdCorrespondant());
				ps.setObject(2, dtoCorrespondantEleve.getIdEleve());
 
				ps.executeUpdate();
				 
				ps.close();
			} 
 
			catch (Exception e) {
				LOG.error(e);
				throw new RuntimeException(e);
			} 
				 
		} 
	} 
Connect your IDE to all the code out there  Get Codota for Java