<commit_before>/**
 * Copyright (C) 2011 Akiban Technologies Inc.
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see http://www.gnu.org/licenses.
 */

package com.akiban.sql.test;

import java.sql.*;

public class SQLClient
{
    public static void main(String[] args) throws Exception {
        if (args.length < 5) {
            System.out.println("Usage: SQLClient driver url user password sql params...");
            String uname = System.getProperty("user.name", "user");
            System.out.println("e.g. 'org.postgresql.Driver' 'jdbc:postgresql://localhost:15432/" + uname + "' '" + uname + "' '" + uname + "' 'SELECT * FROM customers'");
            System.exit(1);
        }
        Class.forName(args[0]);
        Connection conn = DriverManager.getConnection(args[1], args[2], args[3]);
        String sql = args[4];
        System.out.println(sql);
        PreparedStatement stmt = conn.prepareStatement(sql);
        for (int i = 5; i < args.length; i++) {
            stmt.setString(i - 4, args[i]);
        }
        ResultSet rs = stmt.executeQuery();
        ResultSetMetaData md = rs.getMetaData();
        for (int i = 1; i <= md.getColumnCount(); i++) {
            if (i > 1) System.out.print("\t");
            System.out.print(md.getColumnName(i));
        }
        System.out.println();
        while (rs.next()) {
            for (int i = 1; i <= md.getColumnCount(); i++) {
                if (i > 1) System.out.print("\t");
                System.out.print(rs.getString(i));
            }
            System.out.println();
        }
        stmt.close();
        conn.close();
    }
}
<commit_msg>Command line client processes update statements.<commit_after>/**
 * Copyright (C) 2011 Akiban Technologies Inc.
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see http://www.gnu.org/licenses.
 */

package com.akiban.sql.test;

import java.sql.*;

public class SQLClient
{
    public static void main(String[] args) throws Exception {
        if (args.length < 5) {
            System.out.println("Usage: SQLClient driver url user password sql params...");
            String uname = System.getProperty("user.name", "user");
            System.out.println("e.g. 'org.postgresql.Driver' 'jdbc:postgresql://localhost:15432/" + uname + "' '" + uname + "' '" + uname + "' 'SELECT * FROM customers'");
            System.exit(1);
        }
        Class.forName(args[0]);
        Connection conn = DriverManager.getConnection(args[1], args[2], args[3]);
        String sql = args[4];
        System.out.println(sql);
        PreparedStatement stmt = conn.prepareStatement(sql);
        for (int i = 5; i < args.length; i++) {
            stmt.setString(i - 4, args[i]);
        }
        if (stmt.execute()) {
            ResultSet rs = stmt.getResultSet();
            ResultSetMetaData md = rs.getMetaData();
            for (int i = 1; i <= md.getColumnCount(); i++) {
                if (i > 1) System.out.print("\t");
                System.out.print(md.getColumnName(i));
            }
            System.out.println();
            while (rs.next()) {
                for (int i = 1; i <= md.getColumnCount(); i++) {
                    if (i > 1) System.out.print("\t");
                    System.out.print(rs.getString(i));
                }
                System.out.println();
            }
        }
        else {
            int count = stmt.getUpdateCount();
            System.out.println(count + " rows updated.");
        }
        stmt.close();
        conn.close();
    }
}

{'fraction_non_alphanumeric': 0.12891909668932253, 'fraction_numerical': 0.010085507564130673, 'mean_word_length': 2.208157524613221, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4932581', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1259, 'n_words': 406}