ClientDriver for remote access and EmbeddedDriver for local access
authorMarkus Bröker <mbroeker@largo.dyndns.tv>
Tue, 27 Apr 2010 14:51:02 +0200
changeset 123 07b2c0b991af
parent 122 50ba3b0e271a
child 124 8a983ee5fab7
ClientDriver for remote access and EmbeddedDriver for local access The default constructor should always use the simplest, possible way to connect to an embedded database. committer: Markus Bröker <mbroeker@largo.homelinux.org>
javadb/org/homelinux/largo/app/App.java
javadb/org/homelinux/largo/sql/client/DBClient.java
--- a/javadb/org/homelinux/largo/app/App.java
+++ b/javadb/org/homelinux/largo/app/App.java
@@ -5,12 +5,7 @@
 public class App {
 	public static void main (String args[]) {
 		try {
-			DBClient db = new DBClient (
-					"org.apache.derby.jdbc.EmbeddedDriver",
-					"jdbc:derby:clubstatistik",
-					null, null
-			);
-
+			DBClient db = new DBClient ();
 			db.query ("select * from euroleague order by team");
 
 			while (db.hasNext ()) {
--- a/javadb/org/homelinux/largo/sql/client/DBClient.java
+++ b/javadb/org/homelinux/largo/sql/client/DBClient.java
@@ -22,7 +22,7 @@
 	 */
 	public DBClient () throws Exception {
 		this.driver = "org.apache.derby.jdbc.EmbeddedDriver";
-		this.dbURL = "jdbc:derby://localhost/clubstatistik";
+		this.dbURL = "jdbc:derby:clubstatistik";
 
 		this.username = null;
 		this.password = null;