In case the
getUserID() method (looks like it is doing that) is to insert into two tables
UserStocks and
Stocks there should be two
executeUpdate statements. Nested try-catch blocks are not necessary.
All the
JDBC code including
executeUpdate need to be in try-catch blocks. Also, each
PreparedStatement should be closed after its execution. The method name
getUserID() can be changed to a more appropriate name like
insertStocks().
Oracle's
Java JDBC tutorials have good examples of how the API is used.
EDIT: It looks like you are not capturing the stock symbol (its value will be null in the database tables) in the posted code.
SCJP 5, OCPJP 7, 8, SCJD 5, SCWCD 4, SCBCD 5, SCJWS 4, IBM OOAD 833 & 834, MongoDB Developer