<commit_before>package ru.addressbook.tests;

import org.testng.annotations.Test;
import ru.addressbook.model.GroupData;
import ru.addressbook.model.Groups;

import java.sql.*;

/**
 * Created by Админ on 20.05.2017.
 */
public class DbConnectionTest {

    @Test
    public void testDbConnection (){
        Connection conn = null;

        try {
            conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/addressbook?"
                    +"user=root&password=" /*+ "<PASSWORD>?useLegacyDatetimeCode=false&amp;serverTimezone=UTC"*/
                    +"&verifyServerCertificate=false" + "&useSSL=false"+ "&requireSSL=false"
                            + "&useLegacyDatetimeCode=false" + "&amp" + "&serverTimezone=UTC");

            Statement st = conn.createStatement();
            ResultSet rs = st.executeQuery("SELECT group_id, group_name, group_header, group_footer FROM group_list WHERE group_name = 'name'");
            Groups groups = new Groups();
            while(rs.next()){
                groups.add(new GroupData().withId(rs.getInt("group_id")).withName(rs.getString("group_name"))
                        .withHeader(rs.getString("group_header")).withFooter(rs.getString("group_footer")));
            }
            rs.close();
            st.close();
            conn.close();
            System.out.println(groups);
<commit_msg>Получение данных из БД-правка2<commit_after>package ru.addressbook.tests;

import org.testng.annotations.Test;
import ru.addressbook.model.GroupData;
import ru.addressbook.model.Groups;

import java.sql.*;

/**
 * Created by Админ on 20.05.2017.
 */
public class DbConnectionTest {

    @Test
    public void testDbConnection (){
        Connection conn = null;

        try {
            conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/addressbook?"
                    +"user=root&password=" + "&useLegacyDatetimeCode=false&amp&serverTimezone=UTC"
                    /*+"&verifyServerCertificate=false" + "&useSSL=false"+ "&requireSSL=false"
                            + "&useLegacyDatetimeCode=false" + "&amp" + "&serverTimezone=UTC"*/);

            Statement st = conn.createStatement();
            ResultSet rs = st.executeQuery("SELECT group_id, group_name, group_header, group_footer FROM group_list WHERE group_name = 'name'");
            Groups groups = new Groups();
            while(rs.next()){
                groups.add(new GroupData().withId(rs.getInt("group_id")).withName(rs.getString("group_name"))
                        .withHeader(rs.getString("group_header")).withFooter(rs.getString("group_footer")));
            }
            rs.close();
            st.close();
            conn.close();
            System.out.println(groups);

{'fraction_non_alphanumeric': 0.13525337222019687, 'fraction_numerical': 0.00911410864017499, 'mean_word_length': 2.568270481144343, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2895764', 'n_tokens_mistral': 806, 'n_tokens_neox': 771, 'n_words': 129}