<commit_before>/**
 * 
 */
package fh.prog.lab.it.samples.dbServices;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * @author NET
 *
 */
public class Select {

	/**
	 * 
	 */
	
	Statement stmt = null;
	ResultSet rs = null;
	Connection conn = null;
	
	public Select(Connection conn) {
		
		this.conn = conn;
	}

	public boolean doSelect(String table) throws SQLException{
		
		boolean success = false;
		int colCounter = 0;
		String query = "select * from " + table;
		
		this.stmt = conn.createStatement();
		this.rs = stmt.executeQuery(query);
		   
		ResultSetMetaData colInfo = rs.getMetaData();
		   
		colCounter = colInfo.getColumnCount();
		System.out.println("We Have " + colCounter + " columns in the DB.");
		System.out.println("--------------------------");
		
		while(this.rs.next()){
			
			System.out.println("ID		: " + rs.getString(1));
			System.out.println("Product Name	: " + rs.getString(2));
			System.out.println("Version#	: " + rs.getString(3));
			System.out.println("Preis	: " + rs.getString(4));
			if(rs.getString(5) != "N/A"){
			System.out.println("SysAnforderung	: " + rs.getString(5));
			} else continue;
			System.out.println("--------------------------");
		}
		
		
		return success;
		
	}
	
	public boolean closeDB(){
		
		boolean success = false;
		
		try {
			
			this.stmt.close();
			this.rs.close();
			this.conn.close();
			success = true;
		} catch (SQLException e) {<commit_msg>editFrame für das Erstellen/Bearbeiten/Löschen von Einträgen<commit_after>/**
 * 
 */
package fh.prog.lab.it.samples.dbServices;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * @author NET
 *
 */
public class Select {

	/**
	 * 
	 */
	
	Statement stmt = null;
	ResultSet rs = null;
	Connection conn = null;
	
	public Select(Connection conn) {
		
		this.conn = conn;
	}

	public boolean doSelect(String table) throws SQLException{
		
		boolean success = false;
		int colCounter = 0;
		String query = "select * from " + table;
		
		this.stmt = conn.createStatement();
		this.rs = stmt.executeQuery(query);
		   
		ResultSetMetaData colInfo = rs.getMetaData();
		   
		colCounter = colInfo.getColumnCount();
		System.out.println("We Have " + colCounter + " columns in the DB.");
		System.out.println("--------------------------");
		
		while(this.rs.next()){
			
			System.out.println("ID		: " + rs.getString(1));
			System.out.println("Product Name	: " + rs.getString(2));
			System.out.println("Version#	: " + rs.getString(3));
			System.out.println("Preis		: " + rs.getString(4));
			if(rs.getString(5) != "N/A"){
			System.out.println("SysAnforderung	: " + rs.getString(5));
			} else continue;
			System.out.println("--------------------------");
		}
		
		
		return success;
		
	}
	
	public boolean closeDB(){
		
		boolean success = false;
		
		try {
			
			this.stmt.close();
			this.rs.close();
			this.conn.close();
			success = true;
		} catch (SQLException e) {
{'fraction_non_alphanumeric': 0.18234536082474226, 'fraction_numerical': 0.004510309278350515, 'mean_word_length': 2.7364620938628157, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1783863', 'n_tokens_mistral': 1171, 'n_tokens_neox': 1001, 'n_words': 205}