Results 1 to 2 of 2
  1. #1
    JavaLovenJoe is offline Member
    Join Date
    Apr 2008
    Location
    USA
    Posts
    12
    Rep Power
    0

    Question The DatabaseUtils

    Since I make powerful new web application, I need to connect to a DatabaseUtils, but I get exception:
    com.blogspot.joelnkode.tutorial.java.DatabaseUtils Exception: Cannot read from database.
    Java Code:
    import com.blogspot.joelnkode.tutorial.java.*;
    
    public class CoolCode extends NewApplication {
    	public void startHere() {
    		Database db = new DatabaseUtils().
    			connect("localhost", 3306, MY_SQL).
    			with("joe", "ElephantTrunks").
    			go();
    		new DatabaseUtils(db).createTable("Users").
    			addColumn("id", PRIMARY | AUTO).
    			addColumn("username", UNIQUE | NOT_NULL).
    			addColumn("password", NOT_NULL).
    			create();
    		new DatabaseUtils(db).insertRow("Users").
    			set("username", "JavaLovenJoe").
    			setMD5("password", "ElephantTrunks").
    			insert();
    		new OutputUtils(
    			new DatabaseUtils(db).
    				selectFrom("Users").
    				select());
    	}
    }

  2. #2
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    9

    Default

    See the API or support group for your particular library.
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •