20220322 º¹½À


Lego Management System -> DB -> Web ¿¬µ¿



1. Java Build Path -> Classpath (Add External JARs..) -> mysql-connector-java-8.0.27.jar Ãß°¡

2. Deployment Assembly -> Add -> Java Build Path Entries -> mysql-connector-java-8.0.27.jar Ãß°¡

3. DB ¿¬°á/ÇØÁ¦ÇÏ´Â connect()/disconnect() ¸Þ¼­µå ÀÛ¼º.

Connection conn=null;
PreparedStatement pstmt=null;
String jdbc_driver = "com.mysql.cj.jdbc.Driver";
String jdbc_url="jdbc:mysql://127.0.0.1:3306/db53";
String id="root";
String pw="123456";

     try {
          Class.forName(jdbc_driver);
          conn=DriverManager.getConnection(jdbc_url, id, pw);
     } catch (ClassNotFoundException e) {
           e.getStackTrace();
     } catch (SQLException e) {
           e.getStackTrace();
     }


ÆäÀÌÁö ±â´Éº° ÀÚ¼¼ÇÑ ¹®¹ý



lego Table Lego.java

     CREATE TABLE IF NOT EXISTS `lego` (
     `idx` int(10) NOT NULL AUTO_INCREMENT,
     `modelNum` varchar(20) NOT NULL COMMENT '¸ðµ¨¹øÈ£',
     `modelName` varchar(20) NOT NULL COMMENT '¸ðµ¨¸í',
     `year` varchar(50) NOT NULL COMMENT '¿¬µµ',
     `maker` varchar(50) NOT NULL COMMENT 'Á¦Á¶»ç',
     `price` int(10) NOT NULL DEFAULT '0' COMMENT '°¡°Ý',
     `age` int(10) NOT NULL DEFAULT '0' COMMENT '¿¬·É',
     `manual` varchar(50) NOT NULL DEFAULT '0' COMMENT '¼³¸í¼­À¯¹«',
     `reg_date` datetime NOT NULL COMMENT 'µî·ÏÀÏ',
     PRIMARY KEY (`idx`)
     ) ENGINE=InnoDB DEFAULT CHARSET=utf8;


     private String modelNum;
     private String modelName;
     private String year;
     private String maker;
     private String price;
     private int age;
     private String manual;

LegoBean.java Á¶°Ç

     void connect(){
     }
     void disconnect(){
     }
     void updateDB(){
     }
     void deleteDB(){
     }
     void insertDB(){
     }
     void selectDB(){
     }
     void getDB(){
     }

ÃÖ´ë °¡°Ý

ÃÖ¼Ò °¡°Ý

¿¬µµº° Á¦Ç° ¼ö·®


¿ªÇÒ ÆäÀÌÁö

¸ñ·Ï
ÀÔ·Â
¼öÁ¤/»èÁ¦
À妽º->¸ñ·Ï
CSS
ÄÁÆ®·Ñ·¯
¿À·ùó¸®


lego_list.jsp
lego_form.jsp
lego_edit_form.jsp
index.jsp
lego.css
lego_ctl.jsp
lego_error.jsp