Interface between ComputerCraft and any DBMS that comes with a JDBC 4 driver.
( Compatible with Xfel's Peripheral Cables )
Download Links:
v2.0.2 for CC 1.481 - 1.5 (MC 1.4.6 & MC 1.4.7):
- Dropbox: ccDB_2.0.2_mc1.4.7.zip
Changelog:
What can I do with it?
Connect to JDBC-capable databases and then execute queries, read and write data, etc. like e.g.:
executeQuery( "SELECT * FROM accounts.users WHERE password = 'secret'" )
getString( "surname" ) -> returns the element at column-label "surname" of the current row as a String
getBoolean( 3 ) -> returns the element at column-index 3 of the current row as a Boolean
updateString( "nickname", "lamarr" )
Or look at the example in the screenshot above!
Recipe: (subject to change, I'm open for suggestions)
OR
Or in ComputerCraft's creative tab.
Requirements:
Installation:
- Download the necessary JDBC 4 drivers. Each driver should be a .JAR file. Store them to a location of your choice.
- Next, if you use a batch file to launch your MC via Minecraft.jar or a launcher where you can add startup-arguments for MC:
Put the .JAR file into a directory of your choosing (but not the mods folder).
Then add this to your MC startup arguments:
-Djdbc.drivers=com.mysql.jdbc.Driver -Xbootclasspath/a:C:\\mysql-connector-java-5.1.22-bin.jar
Obviously, change com.mysql.jdbc.Driver to the package name of the JDBC driver you're using (see installation docs of the respective driver).
Also change C:\\mysql-connector-java-5.1.22-bin.jar to the path and name you've stored your JDBC .JAR file.
To load multiple drivers, separate them with a colon, like this: -Djdbc.drivers=com.mysql.jdbc.Driver:org.postgresql.Driver
Also add the location of each JDBC driver as a separate -Xbootclasspath/a:LOCATION, where LOCATION is the absolute path to the respective driver.
Lastly, keep in mind that the java command line parameters are case-sensitive!
- As an easier alternative, simply put the .JAR driver file into your Minecraft's mods folder.
If you are on Windows, then it should be %appdata%\.minecraft\mods\
I recommend doing it the former way though, as that loads the drivers together with Minecraft instead of having Forge inject them during the mod loading process.
- As an easier alternative, simply put the .JAR driver file into your Minecraft's mods folder.
- Download this peripheral, it's a .ZIP file. Don't extract it, simply put it into the mods folder as well.
- Done
Available functions:
General usage:
Bugs:
Plans for the future:
"License":
Have fun!
Cheers,
Espen
Old versions (not supported):
Edited by Espen, 28 March 2013 - 06:09 AM.