Update of /cvsroot/firebug/firebug/project/java/src/org/firebug/database
In directory sc8-pr-cvs1:/tmp/cvs-serv6577/project/java/src/org/firebug/database
Modified Files:
MysqlDBHandler.java
Log Message:
Holiday work.
Index: MysqlDBHandler.java
===================================================================
RCS file: /cvsroot/firebug/firebug/project/java/src/org/firebug/database/MysqlDBHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** MysqlDBHandler.java 18 Jul 2003 18:03:26 -0000 1.8
--- MysqlDBHandler.java 3 Jan 2004 13:38:52 -0000 1.9
***************
*** 39,49 ****
/*************** Constructors ***************/
! public MysqlDBHandler() {
setDebug();
setDBProperties("localhost","","3306","root","");
set_c_pool(use_c_pool);
}
public MysqlDBHandler(String host, String port,
String user, String passwd, String dbname) {
--- 39,60 ----
/*************** Constructors ***************/
! public MysqlDBHandler(String dbname) {
setDebug();
setDBProperties("localhost","","3306","root","");
+ this.dbname = dbname;
set_c_pool(use_c_pool);
}
+ /*
+ public MysqlDBHandler(String propfile) {
+
+ this.loadProperties(propfile);
+ connectionqueue = new LinkedList();
+ initializeCQueue(number_of_connections);
+
+ }
+ */
+
public MysqlDBHandler(String host, String port,
String user, String passwd, String dbname) {
***************
*** 51,56 ****
setDebug();
setDBProperties(host,"",port,user,passwd);
- set_c_pool(use_c_pool);
this.dbname = dbname;
}
--- 62,67 ----
setDebug();
setDBProperties(host,"",port,user,passwd);
this.dbname = dbname;
+ set_c_pool(use_c_pool);
}
***************
*** 89,99 ****
- public MysqlDBHandler(String propfile) {
-
- this.loadProperties(propfile);
- connectionqueue = new LinkedList();
- initializeCQueue(number_of_connections);
-
- }
--- 100,103 ----
***************
*** 123,128 ****
! if (debug)
System.out.println("done.");
}
--- 127,133 ----
! if (debug) {
System.out.println("done.");
+ }
}
***************
*** 239,243 ****
}
e.printStackTrace();
! }
return connection;
--- 244,251 ----
}
e.printStackTrace();
! }
! //catch (ConnectException e) {
! // e.printStackTrace();
! //}
return connection;
***************
*** 534,558 ****
} // close loadProps()
-
- /** This method can be called to initialize the dmoz database
- * properties file.
- */
- private static void test() {
-
- MysqlDBHandler dbh = new MysqlDBHandler();
-
- /** Ensure that the properties set in this method
- * are correct, then run it immediately.
- */
- setupDefaults(dbh);
-
- if (TestDBHandler.test(dbh)) {
- System.out.println("Passed MysqlDBHandler unit tests");
- } else {
- System.out.println("Failed MysqlDBHandler unit tests");
- }
- }
-
-
/** Change the properties of the database to reflect the local
* machine, then run make DBHandler.main to write these into
--- 542,545 ----
***************
*** 575,578 ****
--- 562,586 ----
}
+
+ /** This method can be called to initialize the dmoz database
+ * properties file.
+ */
+ private static void test() {
+
+ MysqlDBHandler dbh = new MysqlDBHandler("firebug");
+
+ /** Ensure that the properties set in this method
+ * are correct, then run it immediately.
+ */
+ setupDefaults(dbh);
+
+ if (TestDBHandler.test(dbh)) {
+ System.out.println("Passed MysqlDBHandler unit tests");
+ } else {
+ System.out.println("Failed MysqlDBHandler unit tests");
+ }
+ }
+
+
public static void main(String [] args) {
***************
*** 599,602 ****
--- 607,612 ----
pt.use_c_pool = true;
+ pt.set_dbname("firebug");
+
/* Set the defaults for the local box */
pt.setDBProperties( pt.getDBHost("hostname"), //"127.0.0.1",
***************
*** 606,609 ****
--- 616,621 ----
pt.getDBPass("passwd")); //"tiger"); // oracle
+
+
/* Now check out the connection... */
Connection con = pt.getConnection();
|