Code example for Statement

Methods: close, executeUpdate

0
     * @param sql update sql string 
     * @throws Exception sql exception 
     */ 
    public void executeUpdate(String sql) throws SQLException {
        stmt = dbConnection.createStatement();
        stmt.executeUpdate(sql);
        stmt.close();
    } 
 
    /** 
     * update database information bu giving sql file 
     * 
     * @param sqlFile sql file 
     * @throws Exception sql exception 
     */ 
    public void executeUpdate(File sqlFile) throws SQLException, IOException {
 
        Statement st = null;
        String sql = FileManager.readFile(sqlFile).trim();
        log.debug("Query List:" + sql);
        String[] sqlQuery = sql.split(";");