Question: String sql; private void SaveActionPerformed ( java . awt.event.ActionEvent evt ) { / / TODO add your handling code here: String brand = Brand.getText (
String sql;
private void SaveActionPerformedjavaawt.event.ActionEvent evt
TODO add your handling code here:
String brand Brand.getText;
String description Description.getText;
int idNumber Integer.parseIntIDNumbergetText;
String name Name.getText;
double price Double.parseDoublePricegetText;
int quantity Integer.parseIntQuanitygetText;
String shoeType ShoeType.getText;
final String DBURL jdbc:derby:localhost:TheRunningCompanyDB;
try
java.sqlConnection conn DriverManager.getConnectionDBURL, "app", "app";
java.sqlStatement statement conn.createStatement;
PreparedStatement pstmt conn.prepareStatement;
sql "Insert into Products valuesidNumber name, description, price, quanity, shoeType, brand values ;
try PreparedStatement pstmt conn.prepareStatementsql
pstmtsetInt idNumber;
pstmtsetString name;
pstmtsetString description;
pstmtsetDouble price;
pstmtsetInt quantity;
pstmtsetString shoeType;
pstmtsetString brand;
pstmtexecuteUpdate;
catch SQLException ex
System.out.printlnexgetMessage;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
