1String query = "INSERT INTO artikel VALUES (?, ?, ?, ?, ?)";
2try {
3 PreparedStatement ps = con.prepareStatement(query);
4 ps.setInt(1, aNumb);
5 ps.setString(2, aName);
6 ps.setFloat(3, aPrice);
7 ps.setInt(4, aAvailable);
8 ps.setString(5, aInfo);
9 ps.executeUpdate();
10
11 ps.close();
12 disconnectDB();
13}catch(SQLException e){
14 System.out.println(e.getMessage());
15}