derby

JPA - How to truncate tables between unit tests

I want to cleanup the database after every test case without rolling back the transaction. I have tried DBUnit's DatabaseOperation.DELETE_ALL, but it does not work if a deletion violates a foreign key constraint. I know that I can disable foreign key checks, but that would also disable the checks for the tests (which I want to prevent). ...

How should I use UUID with JavaDB/Derby and JDBC?

I currently use INT as type for primary key in JavaDB (Apache Derby), but since I'm implementing an distributed system I would like to change the type to java.util.UUID. A few questions about this: What datatype in JavaDB/Derby should I use for UUID? I have seen CHAR(16) FOR BIT DATA been mentioned but I don't know much about it. Is VA...

How can I detect what version of JavaDB/Derby I'm using?

I use JavaDB (Derby) as an embedded database in my Java Swing application. I would like to detect and print the version of JavaDB I'm using. I have included derby.jar in my .jar-file for the application. How can I detect and print the version of my embedded JavaDB? ...

Question about Java programming using Derby database

Hey, everyone! I'm havin an error while trying to execute this piece of sql code... The error I'm getting is: Encountered "(" at line 1, column 45 The piece of code is: ALTER TABLE APP.RESPOSTAS ADD coluna" + (numColumns + 1) + " INTEGER(1) AFTER coluna" + numColumns; Can anyone help me? Thank you all! ...

Aren't multiple transactions supposed to concur with em.getTransaction()?

When I execute: public void beginTransaction() { em.getTransaction().begin(); } following an active transaction started in the same way, I get the following exception: Exception Description: Transaction is currently active java.lang.IllegalStateException: Exception Description: Transaction is currently active at ...

Problem with auto-generated primary_key using jpa on DerbyDB

I have jpa annotated entity class like: @Configurable @Entity @Table(name="PLAYERS") public class Player { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name="ID") private Integer id; @Column(name="NAME") private String name; @PersistenceContext public transient EntityManager entity...

Using Hibernate+Derby in Netbeans module

Hi people, I am developing a Netbeans app/module and I like to use a Derby database in it. I created a separate library handling Derby communication (working well). Then I like to use this library in Netbeans module so I imported it as a wrapped library module into my Netbeans app. When compiling I get following warning: Warning: xyz.z...

Resultset not open. Verify Autocommit is OFF. Apache Debry

Hi, I am using apache derby for my database. I am able to perform inserts into the database. The following is the excerpt from the code that attempts to display the contents of my only table 'MAINTAB'. The instance of java.sql.Connection is 'dbconn'. ResultSet word; Statement query; String getData="SELECT THEWORD FROM MAI...