ISSUE :
 
Profile photo
Submitted by Kul Prasad Subedi
on January 28th, 2012 at 11:07:25 EST

Derby Database

I am unable to create database using Java embedded database Derby. The error generated while creating database
at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown So
rce)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.apache.derby.impl.tools.ij.ij.dynamicConnection(Unknown Source)
at org.apache.derby.impl.tools.ij.ij.ConnectStatement(Unknown Source)
at org.apache.derby.impl.tools.ij.ij.ijStatement(Unknown Source)
at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source

at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
at org.apache.derby.tools.ij.main(Unknown Source)
at org.apache.derby.iapi.tools.run.main(Unknown Source)
============= end nested exception, level (3) ===========
Cleanup action completed
ERROR XJ041: Failed to create database 'testdb', see the next exception for det
ils.
ERROR XBM0H: Directory C:\Program Files\Java\jdk1.7.0_02\db\lib\testdb cannot b
created.
ij>


Profile photo
Replied by Yogaraj Khanal
on January 28th, 2012 at 23:11:14 EST
Try to do this as query:
Set Schema <Schema_Name>;
also you can try create = true; in jdbc URL
which will create schema if it doesn't exist that you are trying to connect.
Hope that helps.Please refer to this manual for details.
Accepted Answer
Accepted
 Answer