Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void writeToFile(String artNummer, String titel, String genre, String aldersGrans) throws IOException {
- Connection con = null;
- PreparedStatement pst = null;
- String url = "jdbc:mysql://atlantis.informatik.umu.se/svph1102_db2_vt2012";
- String user = "svph1102";
- String password = "qygebagaq";
- try {
- con = DriverManager.getConnection(url, user, password);
- pst = con.prepareStatement("INSERT INTO spel(artikelNummer, titel, genre, aldersGrans) VALUES(?,?,?,?)");
- pst.setString(1,artNummer);
- pst.setString(2,titel);
- pst.setString(3,genre);
- pst.setString(4, aldersGrans);
- pst.executeUpdate();
- } catch (SQLException ex) {
- System.err.println("Något gick fel" + ex.toString());
- }
- }
- spelRegister.updateSpelet(spelId, artikelNummer, titel, genre, aldersGrans);
Add Comment
Please, Sign In to add comment