derby

Specify at run-time where to create or open Derby embedded database

I want to be able to define the folder where a Derby embedded database will be created after I start my application (which will someday migrate to a web application). The only way I know of setting this folder is by setting the derby.system.home system property -- but this property is read at JVM start-time, and is never refreshed (see r...

Should I be autocreating my DB tables in code, or pre-init during install?

I have a Java application that uses an Apache Derby database with the embedded driver. Right now, in the installation, I run the SQL create scripts out of process. So when the application starts up, the tables are already existing. Recently I've started to think it would be better to have my SQL script in the classpath or something, l...

Bulk Delete ManyToMany collections on Derby

I'm using Hibernate and Derby. I've this class: public class Sensorboard { //... @ManyToMany(fetch=FetchType.LAZY) @JoinTable(name="SENSORBOARD_SENSORBOARD_JOIN", joinColumns= @JoinColumn(name="SENSORBOARD_ID", referencedColumnName="ID"), inverseJoinColumns= @JoinColumn(name="NEXTSENSO...

Drop all constraints in Derby via JDBC

How can I drop all constraints in a Derby database via JDBC? ...

Have additional connections to Derby (read-only)

What I want to do: My application has a full connection to a Derby DB, and I want to poke around in the DB (read-only) in parallel (using a different tool). I'm not sure how Derby actually works internally, but I understand that I can have only 1 active connection to a Derby DB. However, since the DB is only consisting of files on my HD...

mysql dump into derby

Hey, I'm using derby for development in eclipse. Is it possible to dump a table from MySQL and use it for derby in some way? I know that ddl & dml are different for both dbms but I'm looking for a way, other than dump/export, that would be appropriate. ...

Hibernate/JPA + Derby - SELECT statement has too many items in GROUP BY, ORDER BY or select list

I use Hibernate for JPA DB mapping with Derby DB. For a complex object structure I am getting "org.apache.derby.client.am.SqlException: SELECT statement has too many items in GROUP BY, ORDER BY or select list": org.apache.derby.client.am.SqlException: SELECT statement has too many items in GROUP BY, ORDER BY or select list. org....

Converting a Date from a String representation to a numerical representation and back again

Hello Are there any patterns or known ways of converting a date from a string representation to a numerical representation and vice versa? Background: I am using an Apache Derby database as the persistence for a Java program. I would like to do something like this: Select * from MyTable where date_column > 20100914154503 order by date...

How to convert Apache Derby database to MySQL

I would like to convert an existing Derby database to MySQL. ...

MySQL dump .sql script and import to an apache derby

So presumably mysqldump can export to ansi compatible format so that you can import to other vendors' databases. However trying to import to an apache derby I face all this syntax errors. Thought I try some regex and fix things but it seems that there are more than a couple. Is there something I'm missing about mysqldump? Tried ddlutil...

Why does using a prepared statement fail with nulls and succed with GStrings?

The problem in a nutshell: This is what happens when trying to insert a row with a few null columns using a prepared statement and groovy.sql.Sql: groovy:000> val ===> [123123123, 2, null, 0, 0, , null, , 1213020112511801, 1283425009158952, 1, 2, null, 0, 0, , null, , 1213020112511801, 1283425009158952] groovy:000> destSql.execute "ins...

Using Embedded JavaDB

Need to move the database and log files of JavaDB (derby) db files into deployment directories. The database is working in the application startup directory as JavaDB creates a folder with the name of the database (in my case mydb), but I want to move that dir into a subdir called data/ creating data/mydb. I can do this with the connec...

SQLException: No suitable driver found for jdbc:derby://localhost:1527

I get this error in Netbeans: java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/ How is this caused and how can I solve it? ...

Unable to access a read-only Embedded Derby database from within EAR file deployed on JBoss server

I am trying to access a read-only Embedded Derby database. It is available as myDB.jar. This jar has one folder of the Apache Derby database - myDB (log and seg0 folders and service.properties file). This code works fine when I run from a file with a main method. But, when I package it into EAR and deploy it on server it gives error...

Spring JDBC versus Derby Stored Procedure ...

Derby documents syscs_util.syscs_backup_database. I made the following trivial class: public class DerbyMemoryDatabaseDumpDao extends JdbcDaoSupport { private SimpleJdbcCall caller; @PostConstruct public void initialize() { caller = new SimpleJdbcCall(getDataSource()).withCatalogName("SYSCS_UTIL") .with...

What is Derby's equivalent of DB2's "NOT NULL WITH DEFAULT"

I'm investigating how feasible it is to change some unit tests (for an application running on DB2) to use Derby. Having found this question where the answer claims that DB2 and Derby are very compatible, it seemed like a possibility to take DDL out of the DB2 database and run it on a Derby database. But I seem to have found a case where ...

connection cannot be made with derby client jdbc driver

im using Eclipse Helios Java EE IDE for Web Developers,Version: 1.3.0. connection with derby embeded jdbc driver is workin fine but i cannot make connection with derby client jdbc driver... what should i do to make it work,please help me... ...

Drop Derby encryption

I have a Java application which uses an embedded Apache Derby DB for storing data. I want to give the user the option to enable/disable encryption of the database. I found ways to encrypt an unencrypted DB, change encryption keys/algorithms, but the one thing that I couldn't find is how to revert from an encrypted DB back to an unencryp...

having error adding entity classes from database - index: 0, size: 0

hi everyone, i have a problem with generating entity classes in netbeans. i'm certainly doing something wrong since i am beginner with j2ee. i have my derby database with some tables in it and i want to make entity class from one of those tables. unfortunately i get an error which says "Index:0, Size:0" after clicking on finish in the wi...

Browse database tables inside Netbeans with transaction type JTA

Hi, I'm currently learning about Java EE development. I've been using a persistence unit with transaction type RESOURCE_LOCAL up until now, and it was possible to browse the database tables inside Netbeans under the Services tab. I'm using the Derby database org.apache.derby.jdbc.ClientDriver. I had to change transaction type to JTA i...