jsolderitsch wrote:
I got lots of good help with my last query.
I am trying to access a MonetDB through Sun's Glassfish app server.
I am following an example that uses the Java Persistence API and Netbeans 6.0 beta 2 that has some interesting automation to generate code, in particular for configuration file generation that define the jndi context.
But my example doesn't work. My code is based on a tutorial I found that uses Derby which is built into Glassfish.
I see the errors:
TopLink, version: Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007)) Server: unknown RAR5038:Unexpected exception while creating resource RAR5117 : Failed to obtain/create connection from connection pool [ jdbc_monetdb_localhost_demoPool ]. Reason : Connection could not be allocated because: Unable to connect (localhost:45123): Connection refused RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: Connection could not be allocated because: Unable to connect (localhost:45123): Connection refused] Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Unable to connect (localhost:45123): Connection refused Error Code: 0 Local Exception Stack: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Unable to connect (localhost:45123): Connection refused
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.
that looks like an old piece of code..with an old default. I guess that it is overwritten later in the process.
How do I get MonetDB to listen on this port? It seems that the default port is 50000. Is there a conf setting I can make to get this to work?
yes, see the documentation in monetdb.conf and the options for mjclient, the java based textual interface.
What is the difference between portNumber here and port value as checked for in the Driver class?
Any help appreciated.
Jim