[Cherbot-commit] SF.net SVN: cherbot:[133] trunk/src/prj/net/sf/cherbot/PlayerModule.java
Status: Alpha
Brought to you by:
christianhujer
|
From: <chr...@us...> - 2008-12-13 18:49:34
|
Revision: 133
http://cherbot.svn.sourceforge.net/cherbot/?rev=133&view=rev
Author: christianhujer
Date: 2008-12-13 18:49:29 +0000 (Sat, 13 Dec 2008)
Log Message:
-----------
Fixed bugs: Tables were not created, CREATE TABLE statement was wrong. Also improved error verbosity.
Modified Paths:
--------------
trunk/src/prj/net/sf/cherbot/PlayerModule.java
Modified: trunk/src/prj/net/sf/cherbot/PlayerModule.java
===================================================================
--- trunk/src/prj/net/sf/cherbot/PlayerModule.java 2008-12-12 08:52:10 UTC (rev 132)
+++ trunk/src/prj/net/sf/cherbot/PlayerModule.java 2008-12-13 18:49:29 UTC (rev 133)
@@ -25,6 +25,7 @@
/** {@inheritDoc} */
public void load(@NotNull final Connection con) throws SQLException {
+ createTables(con);
final PreparedStatement stmt = con.prepareStatement("SELECT id, serverId, name FROM Player");
final ResultSet result = stmt.executeQuery();
while (result.next()) {
@@ -67,11 +68,12 @@
*/
private void createTables(@NotNull final Connection con) throws SQLException {
try {
- final PreparedStatement stmt = con.prepareStatement("CREATE TABLE Player (id INT, serverId INT, name VARCHAR(32)");
+ final PreparedStatement stmt = con.prepareStatement("CREATE TABLE Player (id INT, serverId INT, name VARCHAR(32))");
stmt.execute();
stmt.close();
} catch (final SQLException ignore) {
System.err.println(ignore);
+ ignore.printStackTrace(System.err);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|