Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL queries

 
natasa jones
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all!
i am new in sql and i would like to insert user's data in two different tables. can i use a single query to do that and how ?or should i have 2 preparedStatements in one class for each insert query?
any help appreciated!
 
Masoud Kalali
Author
Ranch Hand
Posts: 531
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use executeBatch() or you can turn autocommit off before executing sstatements and them execute both of your statement and after you execute both sql statement , you can commint the chanes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic