@@ -59,7 +59,7 @@ private void createMessageTable(Connection connection) throws SQLException
59
59
statement .executeUpdate (dropTable );
60
60
} catch (SQLException e )
61
61
{
62
- System .out .println ("Error dropping message database" );
62
+ System .out .println ("Info - Could not drop message database" );
63
63
}
64
64
65
65
// Create the new table
@@ -71,8 +71,7 @@ private void createMessageTable(Connection connection) throws SQLException
71
71
statement .executeUpdate (createTableStatement );
72
72
} catch (SQLException e )
73
73
{
74
- System .out .println ("Error creating message database" );
75
- e .printStackTrace ();
74
+ System .out .println ("Error creating message database " + e .getLocalizedMessage ());
76
75
}
77
76
}
78
77
@@ -95,7 +94,7 @@ private void createMFEImagesTable(Connection connection) throws SQLException
95
94
}
96
95
catch (SQLException e )
97
96
{
98
- System .out .println ("Error dropping mfe_images table from database" );
97
+ System .out .println ("Info - Could not drop mfe_images table from database" );
99
98
}
100
99
101
100
// Create the new mfe_images table
@@ -109,8 +108,7 @@ private void createMFEImagesTable(Connection connection) throws SQLException
109
108
}
110
109
catch (SQLException e )
111
110
{
112
- System .out .println ("Error creating mfe_images table in database" );
113
- e .printStackTrace ();
111
+ System .out .println ("Error creating mfe_images table in database " + e .getLocalizedMessage ());
114
112
}
115
113
116
114
}
@@ -135,7 +133,7 @@ private void createProductTable(Connection connection) throws SQLException
135
133
statement .executeUpdate (dropTable );
136
134
} catch (SQLException e )
137
135
{
138
- System .out .println ("Error dropping product database " );
136
+ System .out .println ("Info - Could not drop product table " );
139
137
}
140
138
141
139
// Create the new table
@@ -147,8 +145,7 @@ private void createProductTable(Connection connection) throws SQLException
147
145
statement .executeUpdate (createTableStatement );
148
146
} catch (SQLException e )
149
147
{
150
- System .out .println ("Error creating product database" );
151
- e .printStackTrace ();
148
+ System .out .println ("Error creating product table " + e .getLocalizedMessage ());
152
149
}
153
150
154
151
// Populate
@@ -184,7 +181,7 @@ private void createUserAdminTable(Connection connection) throws SQLException
184
181
statement .executeUpdate (dropTable );
185
182
} catch (SQLException e )
186
183
{
187
- System .out .println ("Error dropping user admin database " );
184
+ System .out .println ("Info - Could not drop user admin table " );
188
185
}
189
186
190
187
// Create the new table
@@ -195,8 +192,7 @@ private void createUserAdminTable(Connection connection) throws SQLException
195
192
statement .executeUpdate (createTableStatement );
196
193
} catch (SQLException e )
197
194
{
198
- System .out .println ("Error creating user admin database" );
199
- e .printStackTrace ();
195
+ System .out .println ("Error creating user admin table " + e .getLocalizedMessage ());
200
196
}
201
197
202
198
// Populate
@@ -232,7 +228,7 @@ private void createUserDataTable(Connection connection) throws SQLException
232
228
statement .executeUpdate (dropTable );
233
229
} catch (SQLException e )
234
230
{
235
- System .out .println ("Error dropping user database " );
231
+ System .out .println ("Info - Could not drop user table " );
236
232
}
237
233
238
234
// Create the new table
@@ -244,8 +240,7 @@ private void createUserDataTable(Connection connection) throws SQLException
244
240
statement .executeUpdate (createTableStatement );
245
241
} catch (SQLException e )
246
242
{
247
- System .out .println ("Error creating user database" );
248
- e .printStackTrace ();
243
+ System .out .println ("Error creating user table " + e .getLocalizedMessage ());
249
244
}
250
245
251
246
// Populate it
@@ -289,7 +284,7 @@ private void createLoginTable(Connection connection) throws SQLException
289
284
statement .executeUpdate (dropTable );
290
285
} catch (SQLException e )
291
286
{
292
- System .out .println ("Error dropping user_login table" );
287
+ System .out .println ("Info - Could not drop user_login table" );
293
288
}
294
289
295
290
// Create the new table
@@ -300,8 +295,7 @@ private void createLoginTable(Connection connection) throws SQLException
300
295
statement .executeUpdate (createTableStatement );
301
296
} catch (SQLException e )
302
297
{
303
- System .out .println ("Error creating user database" );
304
- e .printStackTrace ();
298
+ System .out .println ("Error creating user_login table " + e .getLocalizedMessage ());
305
299
}
306
300
307
301
}
@@ -319,7 +313,7 @@ private void createBlindSQLLessonTable(Connection connection) throws SQLExceptio
319
313
}
320
314
catch (SQLException e )
321
315
{
322
- System .out .println ("Error dropping pins table" );
316
+ System .out .println ("Info - Could not drop pins table" );
323
317
}
324
318
325
319
// Create the new table
@@ -334,8 +328,7 @@ private void createBlindSQLLessonTable(Connection connection) throws SQLExceptio
334
328
}
335
329
catch (SQLException e )
336
330
{
337
- System .out .println ("Error creating pins table" );
338
- e .printStackTrace ();
331
+ System .out .println ("Error creating pins table " + e .getLocalizedMessage ());
339
332
}
340
333
341
334
// Populate it
@@ -367,7 +360,7 @@ private void createModifyWithSQLLessonTable(Connection connection) throws SQLExc
367
360
}
368
361
catch (SQLException e )
369
362
{
370
- System .out .println ("Error dropping salaries table" );
363
+ System .out .println ("Info - Could not drop salaries table" );
371
364
}
372
365
373
366
// Create the new table
@@ -381,8 +374,7 @@ private void createModifyWithSQLLessonTable(Connection connection) throws SQLExc
381
374
}
382
375
catch (SQLException e )
383
376
{
384
- System .out .println ("Error creating salaries table" );
385
- e .printStackTrace ();
377
+ System .out .println ("Error creating salaries table " + e .getLocalizedMessage ());
386
378
}
387
379
388
380
// Populate it
@@ -420,7 +412,7 @@ private void createWeatherDataTable(Connection connection) throws SQLException
420
412
statement .executeUpdate (dropTable );
421
413
} catch (SQLException e )
422
414
{
423
- System .out .println ("Error dropping weather database " );
415
+ System .out .println ("Info - Could not drop weather table " );
424
416
}
425
417
426
418
// Create the new table
@@ -432,8 +424,7 @@ private void createWeatherDataTable(Connection connection) throws SQLException
432
424
statement .executeUpdate (createTableStatement );
433
425
} catch (SQLException e )
434
426
{
435
- System .out .println ("Error creating weather database" );
436
- e .printStackTrace ();
427
+ System .out .println ("Error creating weather table " + e .getLocalizedMessage ());
437
428
}
438
429
439
430
// Populate it
@@ -468,7 +459,7 @@ private void createTanUserDataTable(Connection connection) throws SQLException
468
459
statement .executeUpdate (dropTable );
469
460
} catch (SQLException e )
470
461
{
471
- System .out .println ("Error dropping user database " );
462
+ System .out .println ("Info - Could not drop user_data_tan table " );
472
463
}
473
464
474
465
// Create the new table
@@ -481,8 +472,7 @@ private void createTanUserDataTable(Connection connection) throws SQLException
481
472
statement .executeUpdate (createTableStatement );
482
473
} catch (SQLException e )
483
474
{
484
- System .out .println ("Error creating user database" );
485
- e .printStackTrace ();
475
+ System .out .println ("Error creating user_data_tan table " + e .getLocalizedMessage ());
486
476
}
487
477
488
478
// Populate it
@@ -512,7 +502,7 @@ private void createTanTable(Connection connection) throws SQLException
512
502
statement .executeUpdate (dropTable );
513
503
} catch (SQLException e )
514
504
{
515
- System .out .println ("Error dropping tan database " );
505
+ System .out .println ("Info - Could not drop tan table " );
516
506
}
517
507
518
508
// Create the new table
@@ -523,8 +513,7 @@ private void createTanTable(Connection connection) throws SQLException
523
513
statement .executeUpdate (createTableStatement );
524
514
} catch (SQLException e )
525
515
{
526
- System .out .println ("Error creating tan database" );
527
- e .printStackTrace ();
516
+ System .out .println ("Error creating tan table " + e .getLocalizedMessage ());
528
517
}
529
518
530
519
// Populate it
@@ -574,7 +563,7 @@ private void createEmployeeTable(Connection connection) throws SQLException
574
563
statement .executeUpdate (dropTable );
575
564
} catch (SQLException e )
576
565
{
577
- System .out .println ("Error: unable to drop employee table" );
566
+ System .out .println ("Info - Could not drop employee table" );
578
567
}
579
568
580
569
// Create Table
@@ -596,7 +585,7 @@ private void createEmployeeTable(Connection connection) throws SQLException
596
585
statement .executeUpdate (createTable );
597
586
} catch (SQLException e )
598
587
{
599
- System .out .println ("Error: unable to create employee table" );
588
+ System .out .println ("Error: unable to create employee table " + e . getLocalizedMessage () );
600
589
}
601
590
602
591
String insertData1 = "INSERT INTO employee VALUES (101, 'Larry', 'Stooge', '386-09-5451', 'larry',"
@@ -671,7 +660,7 @@ private void createRolesTable(Connection connection) throws SQLException
671
660
statement .executeUpdate (dropTable );
672
661
} catch (SQLException e )
673
662
{
674
- System .out .println ("Error: unable to drop roles" );
663
+ System .out .println ("Info - Could not drop roles table " );
675
664
}
676
665
677
666
try
@@ -682,7 +671,7 @@ private void createRolesTable(Connection connection) throws SQLException
682
671
statement .executeUpdate (createTable );
683
672
} catch (SQLException e )
684
673
{
685
- System .out .println ("Error: Unable to create role table" );
674
+ System .out .println ("Error: Unable to create role table: " + e . getLocalizedMessage () );
686
675
}
687
676
688
677
String insertData1 = "INSERT INTO roles VALUES (101, 'employee')" ;
@@ -722,7 +711,7 @@ private void createAuthTable(Connection connection) throws SQLException
722
711
statement .executeUpdate (dropTable );
723
712
} catch (SQLException e )
724
713
{
725
- System .out .println ("Error: unable to drop auth" );
714
+ System .out .println ("Info - Could not drop auth table " );
726
715
}
727
716
728
717
try
@@ -733,7 +722,7 @@ private void createAuthTable(Connection connection) throws SQLException
733
722
statement .executeUpdate (createTable );
734
723
} catch (SQLException e )
735
724
{
736
- System .out .println ("Error: unable to create auth table" );
725
+ System .out .println ("Error: unable to create auth table: " + e . getLocalizedMessage () );
737
726
}
738
727
739
728
String insertData1 = "INSERT INTO auth VALUES('employee', 'Logout')" ;
@@ -829,7 +818,7 @@ private void createOwnershipTable(Connection connection) throws SQLException
829
818
statement .executeUpdate (dropTable );
830
819
} catch (SQLException e )
831
820
{
832
- System .out .println ("Error: unable to drop ownership" );
821
+ System .out .println ("Info - Could not drop ownership table " );
833
822
}
834
823
835
824
try
@@ -840,7 +829,7 @@ private void createOwnershipTable(Connection connection) throws SQLException
840
829
statement .executeUpdate (createTable );
841
830
} catch (SQLException e )
842
831
{
843
- System .out .println ("Error: unable to create ownership table" );
832
+ System .out .println ("Error: unable to create ownership table: " + e . getLocalizedMessage () );
844
833
}
845
834
846
835
String inputData = "INSERT INTO ownership VALUES (112, 101)" ;
@@ -973,7 +962,7 @@ private void createTransactionTable(Connection connection) throws SQLException
973
962
statement .executeUpdate (dropTable );
974
963
} catch (SQLException e )
975
964
{
976
- System .out .println ("Warning: unable to drop Transactions " );
965
+ System .out .println ("Info - Could not drop transactions table " );
977
966
}
978
967
979
968
try
@@ -986,7 +975,7 @@ private void createTransactionTable(Connection connection) throws SQLException
986
975
statement .executeUpdate (createTable );
987
976
} catch (SQLException e )
988
977
{
989
- System .out .println ("Error: unable to create Transactions : " + e .getLocalizedMessage ());
978
+ System .out .println ("Error: unable to create transactions table : " + e .getLocalizedMessage ());
990
979
throw e ;
991
980
}
992
981
@@ -1008,7 +997,7 @@ private void createTransactionTable(Connection connection) throws SQLException
1008
997
}
1009
998
} catch (SQLException sqle )
1010
999
{
1011
- System .out .println ("Error: Unable to insert data: " + sqle );
1000
+ System .out .println ("Error: Unable to insert transactions: " + sqle . getLocalizedMessage () );
1012
1001
int errorCode = sqle .getErrorCode ();
1013
1002
System .out .println ("Error Code: " + errorCode );
1014
1003
// ignore exceptions for Oracle and SQL Server
0 commit comments