69 757
Assignments Done
Successfully Done
In February 2019

Answer to Question #58073 in Java | JSP | JSF for Lina

Question #58073
The insert statement is working fine for one table but when I try to insert into two it gives an error. Could you see the code below and give me any feedback?

public void insertContact() throws SQLException {

System.out.println("Please enter your ID");
String id = input.next();
System.out.println("Please enter your phone number");
String number = input.next();

try (Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE)) {

ResultSet rs = stmt.executeQuery("SELECT * FROM Contact "
+ "LEFT OUTER JOIN ContactTelNo "
+ "ON Contact.ContactId = ContactTelNo.ContactId");

rs.updateString(idTable, id);
rs.updateString(numberTable, number);
Expert's answer

Not answered

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions