Phil 4.23.13

8:00 – 5:00 SR

  • Backups
  • Meeting with Chris at 2:00?
  • Decided that rather than do updateVizTable and mess with the canonical cars database, I’d start by creating databases and then modifying them. Looks like I might be able to use NOW() for the timestamp column?
  • Creating the appropriate table. Did you know that MySQL doesn’t have a way to determine if a table exists? Here’s how I’m doing it:
    	public boolean tableExists(String tableName){
    		try {
    			DatabaseMetaData metadata = dBconnection.getMetaData();
    			ResultSet resultSet = metadata.getTables(null, null, tableName, null);
    			if(resultSet.next())
    				return true;
    		} catch (SQLException e) {
    			return false;
    		}
    		return false;
    	}
  • So to add a table, you have to create the table with a UID and timestamp, add a line table_data, get the id for that line, then place that id and the roleId into the table_data_role.
  • And here is a script generated test table in VISIBILITY: scriptGenerated

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.