Questions tagged [javadb]

Java DB is Sun's supported distribution of the open source Apache Derby 100% Java technology database. It is fully transactional, secure, easy-to-use, standards-based SQL, JDBC API, and Java EE yet small, only 2.6 MB.

Java DB is Oracle's supported distribution of the Apache Derby open source database. It is fully transactional, secure, easy-to-use, standards-based SQL, JDBC API, and Java EE yet small, only 2.6 MB.

380 questions
2
votes
2 answers

JavaDB - autoincrement among several tables

Is it possible to have autoincrementing id among several tables? What I mean exactly - I have (let's say five) tables, one of them is a table containing information about sales (sale_id, sold_item_id) and another four contain info about different…
spoko
  • 783
  • 1
  • 10
  • 24
2
votes
1 answer

Making a connection between multiple databases

I'm using JAVA DB (derby) I want to import a public view of my data to another database (also in java db). I want to pass this data and save in to the other database. I'm having trouble since the general rule is one connection to one database. Help…
cyrodjohn
  • 23
  • 2
2
votes
1 answer

Netbeans 7.4: Creating entity classes (JPA) from java db embedded database

I am using Netbeans 7.4 to build my application. And also, I am using embedded java db. Now, I want to generate my JPA entities from my database from my database. But, when I rightclick my package -> New -> Entity classes from database, select my…
Prakhar Mishra
  • 1,586
  • 4
  • 28
  • 52
2
votes
1 answer

DB2 / Java DB unit testing

I'm working in a project which is using DB2 + myBatis. Currently I'm defining a concept for test automation and I consider using Java DB (former apache derby) as in memomy db for unit tests. Does anyone have experience with this? Does Java DB can be…
czajek
  • 714
  • 1
  • 9
  • 23
2
votes
1 answer

How to create table in lower case name - JavaDB/Derby?

Is it possible to create table and it's name in lower case using JavaDB/Derby? To check if table exists I'm using: ResultSet rs = dbmd.getTables(null, "APP", "user_properties", null); if (!rs.next()) {/*do something*/}; But table name…
Ernestas Gruodis
  • 8,567
  • 14
  • 55
  • 117
2
votes
1 answer

JavaDB - CREATE TABLE IF NOT EXISTS - how to?

I'm trying to create table using JavaDB (Derby), but if I try to add IF NOT EXISTS: CREATE TABLE IF NOT EXISTS etc (ID BIGINT PRIMARY KEY, title VARCHAR(150)) I get the error: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "NOT" at …
Ernestas Gruodis
  • 8,567
  • 14
  • 55
  • 117
2
votes
1 answer

JavaDB anonymous column name

I am trying to create a generalized UPDATE-statement like this, where only the table-name is fixed. updateValueQuery = conn.prepareStatement("UPDATE TABLENAME SET (?)=(?)"); That fails with an SQLException complaining about syntax. As soon as I…
Max Beikirch
  • 2,053
  • 5
  • 25
  • 36
2
votes
1 answer

apache derby: specifying an ID for a column "GENERATED BY DEFAULT AS IDENTITY"

The following sql statements for apache derby works fine: connect 'jdbc:derby://uri'; create schema TEST02; set schema TEST02 ; create table T ( id INT not null primary key GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), …
Pierre
  • 34,472
  • 31
  • 113
  • 192
2
votes
1 answer

Java - Storing image as a Blob in JavaDB

I'm trying to insert an image into a database, but getting the following: java.sql.SQLDataException: An attempt was made to get a data value of type 'BLOB' from a data value of type 'java.io.InputStream(ASCII)'. I'm using blob in the database. Here…
Abdul Rahim Haddad
  • 689
  • 1
  • 8
  • 14
2
votes
2 answers

How to use the SQL RANDOM() function in a Netbeans JavaDB

I need to do a SQL call in a small local JavaDB in Netbeans 7.2 to pull a single random row from the database. SELECT * FROM JAVA2.FORTUNES ORDER BY RANDOM() So far, I've got it to work using the RANDOM() function, but I'm having trouble getting…
phamousphil
  • 254
  • 4
  • 15
2
votes
2 answers

Is there any difference between using Java DB and Derby?

I am new to Java-based databases. I want to start with Java DB as it comes as a part of JDK. I cannot find enough resources to understand: is Java DB and Apache Derby the same thing? If yes, which one is easier to use from Eclipse? Is it solely…
Limbo Exile
  • 1,321
  • 2
  • 21
  • 41
2
votes
2 answers

similar to last() in sql, what can i use in derby database?

Select Last(column_name) from table_name will return the last value in the column in standard SQL. What is a similar query that will work in derby to fetch the last value in the column? Please find the sample table below: 'secondcol' is the column…
crazyvi
  • 57
  • 1
  • 1
  • 11
2
votes
2 answers

Derby - Getting RETURN_GENERATED_KEYS doesn't seem to be thread safe when using the same Connection to create the PreparedStatement

I run two INSERT sql calls one after the other with Statement.RETURN_GENERATED_KEYS each insert has it's own unique ID assigned to it. Each call is generated with connection.prepareStatement where the connection can be re-used by the different…
Stephane Grenier
  • 15,527
  • 38
  • 117
  • 192
2
votes
1 answer

JavaDB connection error (network protocol)

I'm trying to connect to derby using this: dbProperties.put("create", "true"); dbProperties.put("dataEncryption", "true"); dbProperties.put("encryptionAlgorithm", "DES/CBC/NoPadding"); dbProperties.put("encryptionKey",…
o_O
  • 516
  • 2
  • 8
  • 25
2
votes
2 answers

Database not found error in Apache Derby

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 http://netbeans.org/kb/docs/ide/java-db.html#starting The…
PeakGen
  • 21,894
  • 86
  • 261
  • 463