アットウィキロゴ

ouchi > Dustbox > CustomerInsertDAO的な

  1. package ppp.dao;
  2.  
  3. import java.sql.Connection;
  4.  
  5. import ppp.exception.AppSQLException;
  6.  
  7. public class CustomerInsertDAO extends UpdateNoTxDAOBase {
  8.  
  9. private static final String SQL_BASE = "INSERT INTO customer" +
  10. " (customer_id, company_name, address, telno, dept, customer_name, customer_kana, email, password, last_id, last_time, delete_flag)" +
  11. " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, current_timestamp, false)";
  12.  
  13. public CustomerInsertDAO(Connection conn) {
  14. super(conn);
  15. }
  16.  
  17. @Override
  18. protected String makeSql(Object[] params) throws AppSQLException {
  19.  
  20. if (params == null || params.length != 10) {
  21. throw new AppSQLException("パラメータ数が不正です");
  22. }
  23. System.out.println(SQL_BASE.toString());
  24. return SQL_BASE;
  25. }
  26.  
  27. }
  28.  
最終更新:2013年06月08日 15:44