|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Problem with Derby Embedded ServerHello,
I'm trying to launch Derby Embedded Server - Dervy version which you can use as both Embedded and Network Server. The description is here: http://db.apache.org/derby/papers/DerbyTut/ns_intro.html#Embedded+Server The problem is that I apparently can't launch it properly, since still I am able to connect with it in one way at one time - with Apache Derby Embedded driver or with Apache Derby Client driver, but not with both of them at once. I get the stack trace ('derbyEmbeddedServer' is my database name, 'C:\Program Files\Sun\JavaDB\bin\derbyEmbeddedServer' is where my database is created): java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ040, SQLERRMC: Failed to start database 'derbyEmbeddedServer', see the next exception for details.::SQLSTATE: XSDB6Another instance of Derby may have already booted the database C:\Program Files\Sun\JavaDB\bin\derbyEmbeddedServer. at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source) at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source) at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverManager.java:133) at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.execute(OpenConnectionCommand.java:97) at net.sourceforge.squirrel_sql.client.mainframe.action.ConnectToAliasCommand$SheetHandler.run(ConnectToAliasCommand.java:280) at net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.derby.client.am.SqlException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ040, SQLERRMC: Failed to start database 'derbyEmbeddedServer', see the next exception for details.::SQLSTATE: XSDB6Another instance of Derby may have already booted the database C:\Program Files\Sun\JavaDB\bin\derbyEmbeddedServer. at org.apache.derby.client.am.Connection.completeSqlca(Unknown Source) at org.apache.derby.client.net.NetConnectionReply.parseRdbAccessFailed(Unknown Source) at org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(Unknown Source) at org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(Unknown Source) at org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(Unknown Source) at org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(Unknown Source) at org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessRdb(Unknown Source) at org.apache.derby.client.net.NetConnection.flowUSRIDPWDconnect(Unknown Source) at org.apache.derby.client.net.NetConnection.flowConnect(Unknown Source) at org.apache.derby.client.net.NetConnection.<init>(Unknown Source) at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source) at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source) ... 6 more Has anyone launched Derby Embedded Server successfully? If so, may I ask for some steps on how to do that? |
|
|
Re: Problem with Derby Embedded ServerOK I did it :D
the problem is that setting the property derby.drda.startNetworkServer=true doesnt work to me, but when I added the following lines to my application: import org.apache.derby.drda.NetworkServerControl; import java.net.InetAddress; NetworkServerControl server = new NetworkServerControl (InetAddress.getByName("localhost"),1527); server.start(null); the Derby started to work as embedded server (which means that it is started by the application that contains these lines above and stopped while this application disconnects from Derby) but additionally you can connect to it via the port 1527, as in Network Server case :) So the problem is solved to me. |
|
|
Re: Problem with Derby Embedded Serverbalcerman wrote:
> OK I did it :D > > > the problem is that setting the property > derby.drda.startNetworkServer=true > > doesnt work to me, but when I added the following lines to my application: > > import org.apache.derby.drda.NetworkServerControl; > import java.net.InetAddress; > NetworkServerControl server = new NetworkServerControl > (InetAddress.getByName("localhost"),1527); > server.start(null); > Hi, Good to see that you made it work :) I believe it should work by setting the properties as well. Did you specify the property (or properties) in the derby.properties file, or as Java system properties (either on the command line or using System.setProperty *before* the JDBC driver is loaded)? If you used the file, maybe it was located in the wrong place such that the properties in it didn't get loaded? Regards, -- Kristian > > the Derby started to work as embedded server (which means that it is started > by the application that contains these lines above and stopped while this > application disconnects from Derby) but additionally you can connect to it > via the port 1527, as in Network Server case :) > > So the problem is solved to me. > |
|
|
Re: Problem with Derby Embedded ServerI tried to put it in the VM args in my Eclipse as below: -Dderby.drda.startNetworkServer=true |
| Free embeddable forum powered by Nabble | Forum Help |