code: private String getTableInsertStatement(String table) throws SQLException {
  
          StringBuilder sql = new StringBuilder();
          ResultSet rs;
          boolean addIfNotExists = Boolean.parseBoolean(properties.containsKey(ADD_IF_NOT_EXISTS) ? properties.getProperty(ADD_IF_NOT_EXISTS, "true") : "true");
  
  
          if(table != null && !table.isEmpty()){
              rs = stmt.executeQuery("SHOW CREATE TABLE " + "`" + table + "`;");
              while ( rs.next() ) {
                  String qtbl = rs.getString(1);
                  String query = rs.getString(2);
                  sql.append("\n\n--");
                  sql.append("\n").append(MysqlBaseService.SQL_START_PATTERN).append("  table dump : ").append(qtbl);
                  sql.append("\n--\n\n");
  
                  if(addIfNotExists) {
                      query = query.trim().replace("CREATE TABLE", "CREATE TABLE IF NOT EXISTS");
                  }
  
                  sql.append(query).append(";\n\n");
              }
  
              sql.append("\n\n--");
              sql.append("\n").append(MysqlBaseService.SQL_END_PATTERN).append("  table dump : ").append(table);
              sql.append("\n--\n\n");
          }
  
          return sql.toString();
      }
docs: This will generate the SQL statement
  for creating the table supplied in the
  method signature
  @param table the table concerned
  @return String
  @throws SQLException exception