Advertisement
Guest User

Untitled

a guest
Jun 9th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public static void connect(){
  2. try {
  3. Class.forName("oracle.jdbc.driver.OracleDriver");
  4.  
  5. con = DriverManager.getConnection(
  6. "jdbc:oracle:thin:@localhost:1521:xe ", login, pass);
  7. stmt = con.createStatement();
  8. System.out.println("pomyslnie polaczono");
  9.  
  10. } catch (Exception e) {
  11. e.printStackTrace();
  12.  
  13. }
  14. }
  15.  
  16. public static void dodaj(){
  17. try {
  18. String QueryDodaj = "{call DODAJ_SALE (?,?)}";
  19. pst = con.prepareCall(QueryDodaj);
  20. pst.setString(1, "22");
  21. pst.setString(2, "2");
  22. pst.executeQuery();
  23.  
  24. } catch (Exception ex) {
  25.  
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement