@@ -230,7 +230,7 @@ public void updateData(String tableName, String primaryKey, String primaryKeyVal
230230 }
231231 }
232232
233- public void logEntireDatabase () {
233+ public void logDatabase () {
234234 try {
235235 DatabaseMetaData metaData = getConnection ().getMetaData ();
236236 try (ResultSet tables = metaData .getTables (null , null , "%" , new String []{"TABLE" })) {
@@ -244,7 +244,10 @@ public void logEntireDatabase() {
244244 }
245245 }
246246
247- private void logTable (String tableName , DatabaseMetaData metaData ) throws SQLException {
247+ public void logTable (String tableName ) throws SQLException {
248+ logTable (tableName , getConnection ().getMetaData ());
249+ }
250+ public void logTable (String tableName , DatabaseMetaData metaData ) throws SQLException {
248251 List <String > columns = getTableColumns (tableName , metaData );
249252 logTableContents (tableName , columns );
250253 }
@@ -301,13 +304,13 @@ private void logTableContents(String tableName, List<String> columns) throws SQL
301304 index ++;
302305 }
303306 String title = " Table: " + tableName + " " ;
304- String divider = String .join ("" , Collections .nCopies (Math .max ((lines .get (0 ).length () - title .length ()) / 2 , 0 ), "-" ));
307+ String divider = String .join ("" , Collections .nCopies (Math .max ((lines .get (0 ).length () - title .length ()) / 2 , 3 ), "-" ));
305308 String combined = divider + title + divider ;
306309 combined += combined .length () < lines .get (0 ).length () ? "-" : "" ;
307310 logger .log ("\n " + combined );
308311 for (String line : lines )
309312 logger .log (line );
310- logger .log (String .join ("" , Collections .nCopies (lines . get ( 0 ) .length (), "-" )));
313+ logger .log (String .join ("" , Collections .nCopies (divider .length (), "-" )));
311314 }
312315
313316 private Connection getConnection () throws SQLException {
0 commit comments