<commit_before>/**
 * Author: <NAME>
 * Date: 4/2/2013
 * Last Updated: 4/4/2013
 * Description: Used to access the database in the tweetscrape app.
 * 
 * 
 *  
 **/



public class tweetscrapeDB 
{
	private String databaseName; //
	private String tweetTableName; // tweetscape_
	private String prefix = "ts_"; // Prefix which is used before tables user and database names
	private int Port = 3306; 
	private String databaseUserName; // Database username root
	private String databaseWriterUserName = "writer"; // The common username for the inserter. 
	private String databaseReaderUserName = "reader"; // Username which will check status of database
	
	
	
	public tweetscrapeDB() 
	{
		
	}
	
	public void createTables()
	{
		
	}
	
	public void insertTweet()
	{
		
	}
	
	public boolean tablesCreated()
	{
		//check to see if the tables exist
		boolean checkresult = false;
		
		return checkresult; 
	}
	
}<commit_msg>Update tweetscrapeDB.java<commit_after>/**
 * Author: <NAME>
 * Date: 2013/04/02
 * Last Updated: 2013/05/01
 * Description: Used to access the database in the tweetscrape app.
 * 
 * 
 *  
 **/

import java.sql.*;

public class tweetscrapeDB 
{
   private tweetscrapeGUI tsGUI;
   private String prefix                  = "ts_"; // Prefix which is used before tables user and database names
	private String databaseName            = prefix + "storage"; //tweetscape_essentials 
	private String tweetTableName          = prefix + "tweet"; // 
   private String userTableName           = prefix + "user";
   private String scrapeTableName         = prefix + "scrape"; 
	
	private int Port = 3306; 
	private String databaseUserName;       // Database username
	private String databaseWriterUserName  = prefix + "writer"; // The common username for the inserter. 
	private String databaseReaderUserName  = prefix + "reader"; // Username which will check status of database
   
   private Connection conn; // database connection
	
   public tweetscrapeDB()
   {
	   
   }
	
	public tweetscrapeDB(tweetscrapeGUI inc_tsGUI) 
	{
		tsGUI = new tweetscrapeGUI("run");
		tsGUI = inc_tsGUI;
		
	
	}
	
   //prompt database Credentials 
   public boolean promptdbcreds()
   {
   
	   
	   return false;
   }
   
	public void createTables()
	{
		
	}
   
   //Create Tweet Database Table


   public void executeQuery()
   {

   }
   
   private Connection startConnection()
   {
      Connection conn = null;
      String url = "jdbc:mysql://localhost:3306/";
      String driver = "com.mysql.jdbc.Driver";
      String userName = "root";
      String password = "password";
      try 
      {
         Class.forName(driver).newInstance();
         conn = DriverManager.getConnection(url+databaseName,userName,password);
         System.out.println("Connected to the database");
         
         
         
      } 
      catch (SQLException qe) {
   		System.out.println("Connection Failed! Check output console");
   		qe.printStackTrace();
   		
	   }
      catch (Exception e) 
      {
         System.out.println("NO CONNECTION ");
      }
      
      return conn;
   }
   
   private void endConnection(Connection inc_conn)
   {
      try 
      {
         inc_conn.close();
         System.out.println("Disconnected from database");
      } 
      catch (SQLException qe) 
      {
         System.out.println("Connection Failed! Check output console");
         qe.printStackTrace();
      }
      catch (Exception e) 
      {
         System.out.println("NO CONNECTION ");
      }
   }

 
   public void createTweetDBT()
   {
   
   String creationQuery = "CREATE TABLE IF NOT EXISTS `"+tweetTableName+"` (" +
   		"`tweetid` int(11) NOT NULL AUTO_INCREMENT," +
   		"`scrapeid` int(11) NOT NULL," +
   		"`twitterid` int(11) NOT NULL," +
   		"`created_at` datetime NOT NULL," +
   		"`captured_at` datetime NOT NULL," +
   		"`text` varchar(160) NOT NULL," + 
   		"`geolocation` int(11) NOT NULL," +
   		"`latlong` point DEFAULT NULL," +
   		"`placeid` int(11) DEFAULT NULL," +
   		"`country` int(11) DEFAULT NULL," +
   		"`countryCode` int(11) DEFAULT NULL," +
   		"`fullname` int(11) DEFAULT NULL," +
   		"`place_lat` int(11) DEFAULT NULL," +
   		"`place_long` int(11) DEFAULT NULL," +
   		"`streetaddress` int(11) DEFAULT NULL," +
   		"`place_url` int(11) DEFAULT NULL," +
   		"`userlocationtext` int(11) DEFAULT NULL," +
   		"PRIMARY KEY (`tweetid`)" +
   		") ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;";
   }
	
	public void insertTweet()
	{
		
	}
	
	public boolean tablesCreated()
	{
		//check to see if the tables exist
		boolean checkresult = false;
		
		return checkresult; 
	}
	
}
{'fraction_non_alphanumeric': 0.10816062176165803, 'fraction_numerical': 0.015328151986183074, 'mean_word_length': 2.550191570881226, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1513858', 'n_tokens_mistral': 1571, 'n_tokens_neox': 1394, 'n_words': 393}