I don't have time to support or code this anymore, someone has taken it over please click here to visit his thread.
This is great alta, thanks Once I've watched and understood this I'll add it to the wiki along with links and a little writeup.
Thanks, I hope this makes it easier! If you make any plugins using this, I would love to try them out, send me a link!
Im making a plugin where players can purchase a spawn point with a sign I'll use it to store their spawns maybe :9
yeah i do get that error but... it doesnt seem to cause any harm the error is when the mail is recieved or someone types /mail read.. hope this helps!
Yeah, it's just a simple query to write to the database, it shouldn't even return a result set as far as I know.
I also get this error While it doesn't seem to cause any problems I like to have an error free console
Yes me too i think its trying to create a new db and ignoring that there is a still a db there but yeah error free console >= sex (That was a joke)
I'm almost finished a reporting plugin with the awesomeness of alta's SQL library and w3schools I'll post the link here when finished, should be just under an hour.
When are you getting this error? When creating a table or when inserting to the table? Also I updated the lib, look at the change log. I added "insertQuery(String query)" so that you will not get the "Error at SQL Query: query does not return ResultSet" error!
First download the lib again to update to the new version of the lib and then in the onEnable() you want to initialize the database like this: Code: dbManage = new sqlCore(this.log, this.logPrefix, "mails", pFolder.getPath()); dbManage.initialize(); if (!dbManage.checkTable("mails")) { String query = "CREATE TABLE mails ( 'id' INTEGER PRIMARY KEY, 'sender' VARCHAR(80) NOT NULL , 'receiver' VARCHAR(80) NOT NULL , 'message' TEXT NOT NULL , 'read' INT NOT NULL DEFAULT 0);"; dbManage.createTable(query); }
Alta's amazing SQL tutorial helped me make this http://forums.bukkit.org/threads/ad...port-rule-breakers-700-766.17179/#post-294625
Im not sure.. but.. Code: public void deleteMail (Player player) throws SQLException { String query = "DELETE id, sender, receiver, message, read FROM mails WHERE receiver = '" + player.getName() + "';"; ResultSet result = plugin.dbManage.sqlQuery(query); if (result == null) { plugin.log.info(plugin.logPrefix + "No result at delete mail!"); return; } and Code: if (args[0].equalsIgnoreCase("delete") && player != null) { if ((args.length == 1)) { try{ if (mmServer.getUnreadCount(player.getName()) >= 1) { mmServer.deleteMail(player); } else { player.sendMessage(ChatColor.RED + "No Messages to delete!"); } } catch (SQLException e) { e.printStackTrace(); } } else { player.sendMessage(ChatColor.RED + "Deleting mail was unsucessful!"); } might be good for deleting mail, i havent worked with SQLite before and this is just speculation really and to reload the database for some reason Code: if (args[0].equalsIgnoreCase("reload") && player != null) { if ((args.length == 1)) { if(player.isOp()){ dbManage.close(); System.out.println("[Mail] Database Closed."); dbManage.initialize(); System.out.println("[Mail] Database Loaded."); player.sendMessage(ChatColor.GREEN + "[Mail] Database has been reloaded"); }else { player.sendMessage(ChatColor.RED + "[Mail] Only Admins can reload the database"); } }
Thanks I'll add these when I update the tutorial, I am going to make a text tutorial instead this time so that I dont have to keep remaking, reuploading, and reposting the tutorial!
No problems, i think they should work, im just sorting out my onCommand because i killed it somehow ahh yeah text would be easier to manage you should do one on.. onCommand etc? and sending messages, broadcasting messages? because that would be great, i ALWAYS screw up the onCommand and its bugging me xD