package io.khasang.webstore.model;

public class InsertDataTable {
}

@@ -60,10 +60,1297 @@
 Table %7B%0A
+    public static String sqlCheck;%0A%0A    public void sqlInsert() %7B%0A        SimpleDriverDataSource dataSource = new SimpleDriverDataSource();%0A        dataSource.setDriverClass(com.mysql.jdbc.Driver.class);%0A        dataSource.setUsername(%22root%22);%0A        dataSource.setUrl(%22jdbc:mysql://localhost/webstore%22);%0A        dataSource.setPassword(%22root%22);%0A        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);%0A        System.out.println(%22try to update db...%22);%0A        try %7B%0A            System.out.println(%22Creating tables%22);%0A            jdbcTemplate.execute(%22DROP TABLE IF EXISTS products%22);%0A            jdbcTemplate.execute(%22create table products(ID INT NOT NULL,%22%0A                    + %22 pname MEDIUMTEXT NOT NULL, description MEDIUMTEXT NOT NULL)%22);%0A            jdbcTemplate.update(%22INSERT INTO products(ID, pName, description) VALUES(7, 'milk', 'cow')%22);%0A            jdbcTemplate.update(%22INSERT INTO products(ID, pName, description) VALUES(8, 'bread', 'grey')%22);%0A            sqlCheck = %22db updated%22;%0A        %7D catch (Exception e) %7B%0A            sqlCheck = %22Have error: %22 + e;%0A            System.err.println(sqlCheck);%0A        %7D%0A    %7D%0A%0A    public String sqlInsertCheck() %7B%0A        InsertDataTable sql = new InsertDataTable();%0A        sql.sqlInsert();%0A        return sqlCheck;%0A    %7D%0A
 %7D%0A

change sql query with insert data to products