private String[] getColumnsNames(String tabla) {
        String[] columns = new String[getColumns(tabla)];
        String query = "SELECT column_name FROM information_schema.columns WHERE table_name='" + tabla + "' AND table_schema='" + vg.baseDeDatos + "' GROUP BY column_name ORDER BY column_default";
        try {
            PreparedStatement pstm = (PreparedStatement) conectar().prepareStatement(query);
            ResultSet res = pstm.executeQuery();
            int i = 0;
            while (res.next()) {
                columns[i] = res.getString("column_name");
                i++;
            }
            res.close();
        } catch (Exception e) {
            System.out.println("Problemas al obtener el nombre de las columnas:\n" + e);
        }
        return columns;
    }