Questions tagged [derby]

Use this tag for questions about Apache Derby, an Apache DB subproject. Derby is an open source relational database implemented entirely in Java and available under the Apache License, Version 2.0.

Apache Derby, an Apache DB subproject, is an open source relational database implemented entirely in Java and available under the Apache License, Version 2.0.

Some key advantages include:

  • a small footprint
  • Java, JDBC, and SQL standards
  • embedded Java-based solutions in addition to traditional client/server support
  • and easy of installation and deployment.

From Java 6 onward a version of Derby is included in the JDK.

Useful Links

2643 questions
7
votes
2 answers

SQL Exception: A truncation error was encountered trying to shrink VARCHAR '...' to length x

I know really little about sql, can anyone give me a deeper explanation (or references) of what do this exception means? --update data to add in VARCHAR…
The Student
  • 27,520
  • 68
  • 161
  • 264
7
votes
2 answers

conditional statements in derby

It looks like derby doesn't support conditional statements [IF]. How do we write if exists (select 1 from customers where name='somename') update customers ... else insert into customers ... in derby? Derby doesn't have 'replace into' of…
Fakrudeen
  • 5,778
  • 7
  • 44
  • 70
7
votes
1 answer

Correct format of sql query in java

I can seem to get the syntax correct for a jpa query towards the database. It works perfectly fine using squirrel SQL. The database is Derby and the code is using JPA. Updated with new query and error. This leads me to believe it's something in the…
user2130951
  • 2,601
  • 4
  • 31
  • 58
7
votes
3 answers

Converting from String to Clob using setString() not working

I am trying to convert a String into a Clob to store in a database. I have the following code: Clob clob = connection.createClob(); System.out.println("clob before setting: " + clob); clob.setString(1,"Test string" ); System.out.println("clob after…
Bugalugs Nash
  • 492
  • 1
  • 6
  • 21
7
votes
2 answers

Change Derby DB password

I have already set a Derby DB password in Glassfish/Netbeans. I also checked the remember me checkbox. Now I cannot change the password anymore.
Robot Mess
  • 949
  • 1
  • 7
  • 31
7
votes
4 answers

Apache Derby - java.sql.SQLException: Failed to start database

First, this is my first time with Apache Derby. I am using netbeans, willing to use embedded apache derby, and I followed the following tutorial for configuring and installing the database. Then, I attached the derby.jar file to my project, using…
PeakGen
  • 21,894
  • 86
  • 261
  • 463
7
votes
2 answers

Can I Connect Apache Derby DataBase with Android Application?

I'm preparing an Android Application related to restaurant management. I need to connect the application in another windows application like pos software. That windows application uses Apache Derby database. Can I connect that windows pos with front…
USER5762
  • 277
  • 5
  • 14
7
votes
1 answer

How to browse a derby memory database with Eclipse Datasource Explorer?

For unit testing I use a derby in-memory database. Is there any chance to connect to this database using a tool like Eclipse Datasource Explorer when the test is running? I googled a lot and sometimes I found something like: Connection-URL:…
Subby
  • 1,997
  • 4
  • 22
  • 38
7
votes
4 answers

Unable to have correct value with SELECT query using MAX() in JPA

I am new in JPA and I have a problem when I try to query to the database using MAX() function. Code of my function is following. Can anyone help me? Thank you. public int getMaxId(){ entityManager =…
Spacemonkey
  • 1,725
  • 3
  • 20
  • 44
6
votes
3 answers

java.sql.SQLException: Schema 'ROOT' does not exist

i am using hibernate with embeded derby, and i want hibernate to create the database and the tables, so i tried the following configuration, but i am getting the error: java.sql.SQLException: Schema 'ROOT' does not exist here/s my configuration: …
Mahmoud Saleh
  • 33,303
  • 119
  • 337
  • 498
6
votes
2 answers

Derby - constraints

In the Derby server, how can you use the information in the system tables of the schema to create a select statement in order to retrieve the constraint names for each table?
Artem Barger
  • 40,769
  • 9
  • 59
  • 81
6
votes
2 answers

Schema is not dropped on hbmddl.auto = create.drop

I am using hbmddl.auto set to create in the hibernate configuration file and using it to connect to the derby database in network mode (not embedded, don't know if that is relevant). Here is my hibernate.cfg.xml
Asif Mohammed
  • 790
  • 4
  • 11
  • 25
6
votes
1 answer

sql create sequence number in subset - apache derby

Able to generate Sequence number using the following query CREATE SEQUENCE seqno AS integer START WITH 1; SELECT t1.*, (NEXT VALUE FOR seqno) AS seqno FROM (SELECT l.TRANSACTION_ID, l.HSN FROM RWLINEITEM l WHERE…
vels4j
  • 11,208
  • 5
  • 38
  • 63
6
votes
3 answers

Case insensitive search in Java DB (Derby)

I'm using Derby and I can't find a way to do case insensitive search. For example, I have a table that I'm searching that contains "Hello" but I put a search query in for "hello" and at the moment I won't get a result, but I want to. I can't find…
Sara
  • 612
  • 5
  • 21
6
votes
0 answers

Is JDBC Connection aquiring with MySQL slower than with Derby, for example?

I use Tomcat C3p0 (JNDI configured inside Tomcat) MySQL (InnoDB) / Derby (not embedded) as Database EHCache (in Memory) Hibernate Testmachine runs WinXP I used Derby for development and wanted to switch to MySQL. I was surprised to see that with…
Michael Pralow
  • 6,560
  • 2
  • 30
  • 46