Skip to content

Commit

Permalink
fix for db auto-creation during first startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanley authored and Vanley committed Jun 19, 2017
1 parent 1d2f598 commit 1dc1f7f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# pixelBus
# pixelBus
code available also on github: https://github.com/Vanley/pixelBus
4 changes: 2 additions & 2 deletions derby.log
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
----------------------------------------------------------------
Mon Jun 19 10:09:47 IST 2017:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.13.1.1 - (1765088): instance a816c00e-015c-bf9d-7911-00000627ed98
Mon Jun 19 10:26:43 IST 2017:
Booting Derby version The Apache Software Foundation - Apache Derby - 10.13.1.1 - (1765088): instance a816c00e-015c-bfac-f7a7-00000627ed50
on database directory /Users/vanley/src/pixelBus/db with class loader sun.misc.Launcher$AppClassLoader@18b4aac2
Loaded from file:/Users/vanley/src/pixelBus/src/lib/derby.jar
java.vendor=Oracle Corporation
Expand Down
4 changes: 3 additions & 1 deletion src/pixel/bus/dao/impl/IGameDataDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pixel.bus.model.enu.GameSpeedEnum;
import pixel.bus.service.GameEngineService;
import pixel.bus.utils.DerbyConnectionUtility;
import pixel.bus.utils.DerbyTableUtility;

import java.sql.Connection;
import java.sql.PreparedStatement;
Expand Down Expand Up @@ -34,7 +35,8 @@ public GameData read() {
return gameData;
}
}catch(Exception e){
e.printStackTrace();
DerbyTableUtility.cleanAll();
System.out.println("Database Created.");
}

return null;
Expand Down

0 comments on commit 1dc1f7f

Please sign in to comment.