Code example for Connection

Methods: prepareStatement

0
	public void setBakiye(int yeniBakiye) {
		try{ 
			 
			String soru = "update hesaplar set bakiye = ? where hesapNo = ? and pin = ? and bakiye = ?";
			con = DriverManager.getConnection(kisi.url, kisi.username, kisi.password);
			p = con.prepareStatement(soru);
			p.setInt(1, yeniBakiye);
			p.setString(2, hspNo);
			p.setString(3, pn);
			p.setInt(4, para);
			p.executeUpdate();
			 
		}catch(SQLException ex){
			System.err.println("Veritabani güncellestirmesi yapilamadi.");
			ex.printStackTrace();
		} 
	} 
	 
	public void paraYatir(int yatirim) {
		setBakiye((para + yatirim));
Experience pair programming with AI  Get Codota for Java