• No replies
9224 Posts

Pinned topic Why is the database not created under db/myDatabaseName?

‏2011-08-19T20:49:58Z |

Why is the Embedded Derby database not created under db/myDatabaseName?

When I attempt run the zero model sync command the database is not created under the database name specified in the zero.config file
My zero.config:

/config/http/port = 8080
/config/db/mydb = {
"class" : "org.apache.derby.jdbc.EmbeddedDataSource",
"databaseName" : "db/changesDB"
/config/defaults/dbKey = "mydb"

However, the database is being created under db/resource.

The console output
command> zero model sync
CWPZC9225I: Using default Derby database configuration. Located at -> db/resource in application root.
CWPZC9223I: Found 2 model types
CWPZC9212I: Created table -> OLDGPSCHANGES for Type -> oldGPSchanges using SQL ->
CREATE TABLE oldGPSchanges (
status VARCHAR(50) NOT NULL,

I want to be able to code a groovy resource handler similar to this snippet:
def onList() {

try {
// Get configured DataManager for data access
def data ='mydb')

// Retrieve employee records via Data Zero
def result = data.queryList('SELECT * FROM changes')

but I the error in the response header of a GET request:

{"errorStatusCode":500,"errorMessage":"The db may not have been Database 'C:\\cpData\\zero115apps\\GPSChgMgr\\db\\changeDB' not found."}
Thank you