Skip to content

Instantly share code, notes, and snippets.

@nunenuh
Created April 1, 2015 09:13
Show Gist options
  • Save nunenuh/f95c6535a62fd550f00b to your computer and use it in GitHub Desktop.
Save nunenuh/f95c6535a62fd550f00b to your computer and use it in GitHub Desktop.
Sample Insert
public void insert(Mahasiswa mhs){
String sql = "INSERT INTO mahasiswa (NIM, NAMA) VALUES(?,?)";
MySQLQuery query = new MySQLQuery();
PreparedStatement st = query.prepareQuery(sql);
st.setString(1, mhs.getNIM());
st.setString(2, mhs.getNAMA());
st.executeUpdate();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment