Update of /cvsroot/monetdb/clients/src/java/src/nl/cwi/monetdb/jdbc
In directory
sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv10052/src/java/src/nl/cwi/monetdb/jdbc
Modified Files:
MonetDataSource.java
Log Message:
propagated changes of Thursday Nov 08 2007 - Saturday Nov 17 2007
from the Clients_1-20 branch to the development trunk
PLEASE NOTE:
I resolved conflicts in
src/java/build.properties
src/java/release.txt
by NOT propagating the version number and release date changes
from the Clients_1-20 branch to the development trunk.
Index: MonetDataSource.java
===================================================================
RCS file:
/cvsroot/monetdb/clients/src/java/src/nl/cwi/monetdb/jdbc/MonetDataSource.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- MonetDataSource.java 3 Jan 2007 12:17:29 -0000 1.2
+++ MonetDataSource.java 17 Nov 2007 18:39:37 -0000 1.3
@@ -38,14 +38,12 @@
* @version 0.1
*/
public class MonetDataSource implements DataSource {
- private String databaseName;
- private String hostName;
- private int portNumber;
private String description;
private int loginTimeout = 0;
private String user;
- // insecure, but no big issue as long as MonetDB itself doesn't do
decent authorisation
+ // insecure, but how to do it better?
private String password;
+ private String url;
// the following properties are also standard:
// private String dataSourceName;
@@ -58,14 +56,12 @@
/**
* Constructor of a MonetDataSource which uses default settings for a
- * connection. You probably want to change these settings using the
- * methods setDatabaseName, setServerName, setPortNumber, etc.
+ * connection. You probably want to change this setting using the
+ * method setURL.
*/
public MonetDataSource() {
- databaseName = "demo";
- hostName = "localhost";
- portNumber = 45123;
description = "MonetDB database";
+ url = "jdbc:monetdb://localhost/";
driver = new MonetDriver();
}
@@ -90,7 +86,9 @@
* @return a MonetConnection
* @throws SQLException if connecting to the database fails
*/
- public Connection getConnection(String username, String password)
throws SQLException {
+ public Connection getConnection(String username, String password)
+ throws SQLException
+ {
if (loginTimeout > 0) {
/// could enable Socket.setSoTimeout(int timeout)
here...
}
@@ -98,10 +96,7 @@
props.put("user", username);
props.put("password", password);
- return(driver.connect(
- "jdbc:monetdb://" + hostName + ":" + portNumber + "/" +
databaseName,
- props
- ));
+ return(driver.connect(url, props));
}
@@ -172,21 +167,21 @@
}
/**
- * Gets the database name
+ * Gets the connection URL
*
- * @return the database name
+ * @return the connection URL
*/
- public String getDatabaseName() {
- return(databaseName);
+ public String getURL() {
+ return(url);
}
/**
- * Sets the database name
+ * Sets the connection URL
*
- * @param databaseName the database name
+ * @param url the connection URL
*/
- public void setDatabaseName(String databaseName) {
- this.databaseName = databaseName;
+ public void setDatabaseName(String url) {
+ this.url = url;
}
/**
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins