jsolderitsch wrote:
Fabian Groffen wrote:
On 14-11-2007 17:07:39 -0800, jsolderitsch wrote:
Cause: Connection could not be allocated because: Unable to connect (localhost:45123): Connection refused] [snip] I looked at the class MonetDataSource in the JDBC jar file and I see that the constructor for MonetDataSource uses 45123 for the field portNumber. But there is no apparent way to set the portNumber to something else.
Oopsie! Legacy! I fixed this in 1.6 Steadfast_p13 which you can pick up from here:
http://www.cwi.nl/~fabian/troep/monetdb-1.6-jdbc.jar and http://www.cwi.nl/~fabian/troep/jdbcclient.jar
I feel it should be possible to change the port number in the DataSource, but I have no clue how. At least I did not when I implemented the class. It's very shallow, but I'm pleased to hear that it actually works for you in your workarounds.
Thanks for the quick update. Yes, this works now without any special configuration on my part. Setting the port number in the MonetDataSource class to 50000 (the default Monet port) made the difference.
Now I don't need to use an explicit port number in my JDBC URL and the DataSource magic being used through Netbeans and Glassfish allow the DB calls to go through successfully.
Now I can get back to my real work...
OK, now a new problem. Glassfish wants to establish a connection pool on behalf of my deployed web application. I want to access a remote database, not one deployed to localhost. But it looks like code in the MonetDataSource is not equipped to allow non-localhost connections. I see in the class: public class MonetDataSource implements DataSource { public MonetDataSource() { loginTimeout = 0; databaseName = "demo"; hostName = "localhost"; portNumber = 50000; description = "MonetDB database"; driver = new MonetDriver(); } But like portNumber, hostName is not available for substitution. Ideally, shouldn't it be possible for the data source to refer to any host and database name. I can see that the port number may be a problem, but what about the host? Or maybe I don't understand the process here but I started up my remote DB, shutdown the local one, changed the URL for the connection to reference the remote DB, but the deployed application fails because it can't connect to localhost. Any ideas? It's looking like I may need to switch to a DB with more complete javax.sgl.DataSource support. Jim -- View this message in context: http://www.nabble.com/Using-DataSource-class-within-MonetDB----connection-er... Sent from the monetdb-users mailing list archive at Nabble.com.