Hi, I'm wondering if someone has run into this and can
help me understand what's happening.
I'm porting some JDBC code from Another Database to Derby;
I'm using Derby 10.1.1.0 on RedHat Linux.
My program contains a snippet of code something like:
PreparedStatement stmt =
What's the best way to access Derby databases from Ruby scripts?
I tried some simple searching on Google, but didn't find
anything obvious.
thanks,
bryan
I'd like to arrange for a NetworkServer instance of Derby
to be automatically started up and shut down on my Red Hat
Linux system, using the conventional chkconfig service
management, as described in , for example,
of our error messages to be more meaningful.
And, no, sorry, I have no idea what this means.
David
Bryan Pendleton wrote:
I got this exception several times today, but I don't know
what it's trying to tell me.
Can anybody take a stab at explaining this error to me in more
layman's terms
David is on target that we probably need a bug to be filed.
Normally when there is a protocol exception it means a bug.
Thanks! I've filed DERBY-614 to track the analysis of this problem.
bryan
Hi all,
I was reading http://www.linux-mag.com/content/view/2134/
(good article, btw!), and it says:
The next two properties are needed to diagnose concurrency
(locking and deadlock) problems.
*derby.locks.monitor=true logs all deadlocks that
occur in the system.
A Guidelines section starts on slide 19. Slide 24 lists 100-500
updates per second -- but, of course, your actual performance will
depend on the complexity of your transactions.
Is there a simple way that I can observe what actual performance
I'm getting? That is, does Derby keep its own
Michael McCutcheon wrote:
I'm implementing a utility class that populates 'beans' with data from
tables in derby.
Aren't you sort of re-inventing the wheel? It seems like there are a
lot of libraries already out there which do this already. Surely
it would be easier to just use an existing
Hi all,
I think this is a bug, but I wanted to ask the list before
reporting it as such.
I am running Derby 10.1.1.0 in Network Server mode.
My application intermittently encounters lock timeouts. To diagnose
them, I have derby.locks.deadlockTrace=true in order to print the
lock table when the
I ran the following experiment, with somewhat surprising results:
create table a (a integer);
autocommit off;
lock table a in exclusive mode;
select * from syscs_diag.lock_table;
insert into a values (1);
select * from syscs_diag.lock_table; -- Note (1) below
commit;
select * from
Mike Matrigali wrote:
the logic is slightly different dependent on isolation level,
what isolation level are you running. All the code gets the
table level intent lock first, and if that succeeds then checks
if it has covering locks such that it does not need to get row
locks.
The code is in
Legolas Woodland wrote:
is there any way to see which commands are coming from clients to Derby
server ?
I mean , i as developer want to see which commands are executed against
my database , what should i do ?
One good way is to set derby.language.logStatementText. It will cause
each
[EMAIL PROTECTED] wrote:
2 3. I have not used derby.properties file but I would assume this file would
be in the folder specified by derby.system.home. In my example it would the
derbydata folder. The network server does nothing other than delegate network
requests to the specified database
Legolas Woodland wrote:
Hi
Thank you for reading my post.
how i can get current date in derby SQL ?
something like Date() ??
http://db.apache.org/derby/docs/10.1/ref/rrefsqlj34177.html
thanks,
bryan
Wondering if there are any good samples of loading data from derby
into a Jtable with column names as headers?
Here's another nice example to get you started:
http://www.javaspecialists.co.za/archive/newsletter.do?issue=118locale=en_US
bryan
Stephen-D Mainstone wrote:
I am trying to use the UserUtility class to add permissions for a given
user.
Possibly you are encountering bug DERBY-87, in which the Derby
documentation incorrectly showed a way to call the UserUtility class?
See: http://issues.apache.org/jira/browse/DERBY-87
I get this error:
org.apache.jasper.JasperException: Failed to create database
'/home/commrcha/chan/db', see the next exception for details.
Often, when you get an error that says 'see the next exception for details',
you need to call getNextException() or getCause() or something like
samy wrote:
I am using derby database(embedded version) in software. I need to
backup the database and also retrieve that backup. So kindly help me to
take backup and retrieve.
This page should provide the information you desire:
Recently, I had a table which was able to substantially
benefit from compression. I determined that I had a problem
by setting derby.logQueryPlan to TRUE, running a select *
query against the table, and then viewing the page and
row count statistics that were emitted in the query plan,
where I
When stress testing a mechanism to simultaneously start the Derby
network server from different applications at the same time, I sometimes
get the following exception:
DRDA_InvalidReplyTooShort.S:Invalid reply from network server:
Insufficient data.
Is this possibly a bug?
I'm not sure I
Robert Rivoir wrote:
java org.apache.derby.tools.dblook -d 'jdbc.derby.calDB'
Try using a colon instead of a period in the -d database URL argument:
java org.apache.derby.tools.dblook -d 'jdbc:derby:calDB'
bryan
Is there a way to bypass this, so when querying the database it does not
look at uppercases or lowercases. è Detroit = detroit = dEtRoIt = …
Try using the UPPER function:
select * from city_info where UPPER(city_name) = 'DETROIT';
thanks,
bryan
What I would like to know is how can I disable row level locking
One way is to alter your application to do:
stmt.executeUpdate(lock table CUSTOMER in exclusive mode);
Where CUSTOMER, of course, is replaced by the actual name of your table.
Once you have done this, Derby will not take any
Is there something to do closing a database to free all memory use by
this database ?
In addition to committing and closing your connections, you can also
shut down the database:
http://db.apache.org/derby/docs/10.1/devguide/tdevdvlp40464.html
thanks,
bryan
Maryam Moazeni wrote:
I would like ti know the storage required for DATE, TIME and TIMESTAMP.
I assume you mean the disk space storage requirement for a column
of such a type?
One simple way to figure this out is to create a table containing
a column of such a type, store a few hundred
The problem is the result from this query returns me after 25 minutes
later. Can anybody suggest anything about What the problem is?
It sounds like you're getting the results that you expect from your
query, but it's taking much longer than you expect.
If that's true, than the problem is that
Here's a nice article on the new JDBC version 4 enhancements
at the O'Reilly web site.
The article uses Derby for its examples.
http://www.onjava.com/pub/a/onjava/2006/08/02/jjdbc-4-enhancements-in-java-se-6.html
Enjoy,
bryan
Trying to create a dataset using BIRT report's designer i have faced a
problem related with white spaces in connection urls.
I believe this is DERBY-618:
http://issues.apache.org/jira/browse/DERBY-618
which has been fixed, and the fix is in Derby version 10.1.2.4.
Can you upgrade to that
But it looks like there is no ALTER TABLE DROP COLUMN ... functionality.
...
Is there an expectation for resolution?
Hi Tim,
Thanks for considering Derby; I think you will find it is very powerful.
You are correct that ALTER TABLE DROP COLUMN is not currently present.
However, as you've
Tim Dudgeon wrote:
1. Should I apply the patch to the 10.1.3.1 sources (e.g. the
db-derby-10.1.3.1-src.zip download) or something else?
The patch is intended to be applied to the current trunk, which
you can fetch from svn via
svn checkout
Stephen Caine wrote:
What we are waiting for is the ability to delete a table column.
It's great to hear that you are having success using Derby!
Regarding the ability to delete a column from a table, you may want
to follow the progress of http://issues.apache.org/jira/browse/DERBY-1489
Where is the patch and how do I 'apply' it?
The patch is an attachment to the JIRA issue. Go to
http://issues.apache.org/jira/browse/DERBY-1489 and look at
the File Attachments section of the web page. You can download
the patch just by clicking on it.
To apply the patch, you'll need to learn
Duncan Groenewald wrote:
Any chance someone can explain how I could modify the parser (or
whatever) to be able to handle the NULL constraint ?
Beware: I haven't tried this, but you could have a look at
java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj and
experimentally try to modify
java.lang.ClassFormatError: Invalid method Code length 69936 in class
There is a hard limit in the JDK class-file format of 64K, and there are
some known issues in Derby which can cause the generated code to exceed
these limits.
Tremendous improvements have been made in this area over recent
Stephen Caine wrote:
Is dropping a column now supported in 10.2.1.3?
Hi Stephen, thanks for trying the beta!
The ALTER COLUMN changes in this beta are DERBY-119 and DERBY-1491,
which allow you to do:
ALTER TABLE t ALTER COLUMN c [ NOT ] NULL
This lets you add or remove the NOT NULL
Michael McCutcheon wrote:
Can I turn on some property and see the SQL's the database is running?
See if this helps:
http://db.apache.org/derby/docs/dev/tuning/rtunproper43517.html
thanks,
bryan
SELECT thingIdx, thingName FROM Things WHERE thingIdx IN (?, ?, ?, ?,
... [100 values scattered throughout index])
performance is pretty slow -- a bit over a minute for 100 records.
I believe this is DERBY-47 (http://issues.apache.org/jira/browse/DERBY-47),
also logged as DERBY-713
I have used Squirrel SQL (http://squirrel-sql.sourceforge.net/) on another
project and found it reasonably ok. I haven't used it with Derby though.
Squirrel works great with Derby! Here's a nice set of notes:
http://db.apache.org/derby/integrate/SQuirreL_Derby.html
thanks,
bryan
Marl Atkins wrote:
Thanks this looks good but is there any way I can point it at an existing
embedded database?
Squirrel works great with Derby! Here's a nice set of notes:
http://db.apache.org/derby/integrate/SQuirreL_Derby.html
Which database to process is controlled by the information
I am having a little better luck now that I have my new Apache Derby Book.
Great! Good to hear you are having success.
set
CLASSPATH=%DERBY_INSTALL%\lib\derby.jar;%DERBY_INSTALL%\lib\derbytools.jar;%DERBY_INSTALL%\lib\derbynet.jar;%CLASSPATH%
wasn’t working. it would set some of the
I can't find any reference in the documentation for renaming columns.
Derby does not yet support this feature.
A request to add such functionality has been logged as DERBY-1490:
http://issues.apache.org/jira/browse/DERBY-1490
thanks,
bryan
All this works great, except that when I connect from outside of tomcat, I
always get a read-only connection.
Do you mean read-only in the sense of
http://db.apache.org/derby/docs/dev/devguide/cdevdeploy11201.html#cdevdeploy11201
Or do you mean read-only in the sense of
I personally consider 3 minutes just to give basic schema information (of a
schema that is *not* particularly big) to be totally unacceptable.
Yes, this sounds like it is way too long.
Can you construct a small standalone test program that demonstrates
the problem? For example, a program along
Is there a jira issue for adding a limit statement (to limit the number
of records returned) to a select statement? I did a jira search but
could find no such issue. I’d like to vote for it.
Hi Jim,
I think DERBY-581 is the issue that tracks this request:
Dropping a column
Can't be done in 10.2, but can be done in the trunk.
DERBY-1489 tracks this feature.
Changing a column's width
Changing a column's type
Increasing the width of a VARCHAR, CHAR VARYING, or
CHARACTER VARYING column has been possible since 10.1,
maybe even since 10.0 or
is there any too that help tunning derby and also sql statement that are
executed against derby database?
There is an entire book devoted to this subject:
http://db.apache.org/derby/docs/dev/tuning/
thanks,
bryan
I'm hoping to use Derby as a backend database. Are there any repair
tool(s) in the event the database is corrupted and needs to be repaired?
I agree with Thomas's observation that a good backup process should
remove most of the need for this.
Also, there is the CHECK_TABLE function, although
I guess someone with more knowledge about Derby's internals may be able
to tell you why your specific query requires a larger stack size.
I think that the query was noted to use an IN clause, so he
may be encountering either http://issues.apache.org/jira/browse/DERBY-47
or
My problems came from a simple query containing an IN clause with 5000
items in it. I went over this easily by increasing the stack size limit
to 1024 KB.
Thanks Robert! That definitely sounds like DERBY-47. If you have the time,
it'd be great to have some help in working on improving this
I don't think this is DERBY-47. DERBY-47 is the issue that the plan
generated by an IN query is inefficient.
This issue is that a query with a large number of IN parameters fails to
compile due to a stack overflow error.
Good point.
Is this issue already known, then? Or would it be helpful
This is why a nested loop is not going to work here... 20,000 squared
operations is very expensive, let alone millions squared. For a query with
this profile, the inner query should only be executed once.
Perhaps you can get the behavior you desire by explicitly creating
a temporary table,
Is this a bug in derby? Is there a workaround? I'm running Derby
10.1.2.1 on Fedora Core 5.
I don't have an explanation for the behavior you are seeing.
I spent a little bit of time trying to reproduce your problem
with a smaller query, but couldn't.
Can you post a complete example script,
I think that Derby currently does not support a CASCADE option on the
DROP TABLE statement.
I searched Jira and found DERBY-1631, which discusses the desire for a
CASCADE option on DROP VIEW, but I could not find a Jira issue logged
to request a CASCADE option on DROP TABLE.
Is there such a
If rewriting the query is not an option, what alternatives are there to
overcome this limitation?
What version of Derby are you using? (Apologies if you already said that
and I missed it). If you are using a version prior to 10.2, you should
definitely try 10.2, as there was a *lot* of work in
I have execute the simple select on this particular view as
SELECT * FROM vwDerbyBaseView using a small java client for all the
derby modes (Embedded and Network)
Then the same error Meta-data for Container
[EMAIL PROTECTED] could not be
accessed was given in the
I tried doing what you said, but the table does not seem to exist.
I am running 10.1.1.0 via the NetworkServerControl API.
In version 10.1, you have to use the old name for the table. Try:
SELECT * FROM NEW org.apache.derby.diag.LockTable() as LOCK_TABLE
See DERBY-571 for more info:
A lock could not be obtained within the time requested this exception.
My queries are as follows
1. Why I am getting this exception?
2. What I should do to avoid this error?
3. How the locking mechanism working in Derby Database?
This is a completely normal exception, and indicates that you
Anybody know when/if Derby will support replication? :-)
Check http://wiki.apache.org/db-derby/UsesOfDerby for some
pointers. There are at least 3 data replication systems listed
there which work with Derby.
thanks,
bryan
Exceeded maximum number of sections 32K
It seems to me that you may be suffering from a resource leak of
some kind. Can you check to make sure that you are closing all of
your ResultSets, Statements, and Connections as soon as you are
finished with them?
Also, tell us a bit more about
I'm looking for simple step-by-step instructions for deploying this
app via tomcat.
Here's a nice article about using Derby via Tomcat:
http://db.apache.org/derby/integrate/DerbyTomcat5512JPetStor.html
thanks,
bryan
ERROR XCL30: An IOException was thrown when reading a 'BLOB' from an
InputStream.
Can you gather and post some more information? Specifically:
- on the client side, call printStackTrace() on your exception,
and call getNextException() to fetch any nested exception and
print that
The length, precision, or scale attribute for column, or type mapping
'VARCHAR(100)' is not valid.
Varchar is definitely limited to 32 thousand bytes as its max length,
see: http://db.apache.org/derby/docs/dev/ref/rrefsqlj41207.html
If you really need a enormous length value, I think you
Alex Moots wrote:
Thanks for the quick response, but the query:
ALTER TABLE bl.USERSPROPERTIES ALTER COLUMN Value SET DATA TYPE CHAR(32000)
Still gives me the same error message:
The length, precision, or scale attribute for column, or type mapping
'CHAR(32000)' is not valid
I think in this
ij connect 'jdbc:db2j:c:\LabFiles60\CloudscapeDB\BANKDB;create=true';
ERROR 08001: No suitable driver
When I changed “db2j” to “derby” IJ just hung!
Are you sure it hung? Maybe it was creating the database. That does
take 30 seconds or so.
'jdbc:derby' is the correct prefix for the
A missing quote and semi colon at the end caused it to hang.
Ah, yes, the missing semicolon. I've made that mistake many
a time myself. Sorry about that. Glad you figured it out!
thanks,
bryan
I just came across this article on java.net, thought people
on this list might be interested in it:
http://today.java.net/pub/a/today/2007/01/16/synchronizing-web-client-database.html
Nice work, David!
thanks,
bryan
Also, how do I find out all the (possibly compound field) indexes that
have been created for a table?
Finally, is there a way to dump the db to a file of SQL commands that
can be used to reconstruct the db?
Hi Amir,
I don't know a way to get any suggestions about indexes which could have
Dan Scott wrote:
Renaming columns will be possible in the as-yet-unreleased 10.3.0
version of Derby according to
https://issues.apache.org/jira/browse/DERBY-1490
Hi Dan, thanks for the nice words!
I just wanted to suggest a couple other ideas that might help in the meantime:
- define a
'jdbc:derby:net://localhost:1527/jayDB;create=true;user=APP;password=APP;';
Try taking the net: out. Having net: in there means to use
the IBM DB2 JDBC driver, also called the JCC driver. The Derby JDBC
driver just uses the prefix jdbc:derby:, so just say jdbc:derby://...
thanks,
bryan
Is there a way to get a list of indexes on a table including the index
name.
This sounds like a nice enhancement request for 'show indexes'.
You could also try looking in sys.sysconglomerates.
SELECT * FROM SYS.SYSCONGLOMERATES
seems to show me the index name, but of course you'll have
A. Rick Anderson wrote:
I'm getting a driver not found exception when running a relatively
trivial derby program from within eclipse. It's frustrating because I
can crack the derby.jar file and the targeted driver class is in the
derby.jar file that is in the build path for the project.
...
alter table TABLE_NAME alter column COL_NAME DEFAULT 'new value'
and with some VARCHAR columns I get an error like this:
Invalid character string format for type long.
Well, I'm not sure what's causing this, but here's what I
think is going on, maybe it makes sense: when you alter the
Are you running in Embedded or in Network Server mode? If
you are running in Network Server mode, you could try
loading your data in Embedded mode, then switching to
Network Server mode for actual *use* of the data. That would
eliminate the Network Server overhead during the load.
thanks,
bryan
In my post I should have said I also showed two queries that are
expected to get syntax errors. --I'm not sure that sample invalid
syntax needs to be put into the docs.
Is there any feedback on using the \r ? In the back of my mind I'm
thinking that won't be portable between Windows and Unix.
I've been looking through the archives, and JIRA, but I can't seem to
find an answer. Basically, will Derby network server be enabled to
run as a daemon? I understand the next version of JAMES has been
modified to use commons-daemon, and wondered if there were plans for
Derby to follow.
java.sql.SQLException: The heap container with container id
Container(-1, 1173965368428) is closed.
Hi Jeff,
I don't have a lot to offer on this problem, but I did try
your test program and I get the same exception, so the problem
reproduces for me.
What was the behavior that you expected to
implicit commit. However, with holdability set to
HOLD_CURSORS_OVER_COMMIT, I no longer get an exception on calling next()
the first time, but rather get good data for 415 calls. On the 416th
call, I get an exception not that the result set is closed, but rather
than an underlying storage
If you're building a Derby application you should just use
the regular JDBC javadoc from your JDK. For example when
you are working with a PreparedStatement you can refer to
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html
thanks,
bryan
Can Derby do this, or does it load the rows regardless?
Yes, Derby can definitely do this. Here's more info:
http://db.apache.org/derby/docs/dev/tuning/ctunperf10679.html
http://db.apache.org/derby/docs/dev/tuning/ctundepth23033.html#ctundepth23033
In the case of the query plan you presented,
I couldn't find an open JIRA entry for enhancing Derby to make
using of opposite-ordered indexes when doing ORDER BY.
I think that DERBY-884 and DERBY-642 are related:
http://issues.apache.org/jira/browse/DERBY-642
http://issues.apache.org/jira/browse/DERBY-884
However, they don't
provided by derby. Following are the code I am using for clean the
database connection and also PreparedStatement.
if(!(aoConnection ==null || aoConnection.isClosed()))
aoConnection.close();//Release Connection
if(aoPreparedStatement != null)
sometimes i get a Connection reset (i'm also investigating why this
happens but i think i've found a problem with derby) when calling a
remote derby db. the connection is closed but the transaction is still
in progress (see last table at the bottom of the mail).
I think that a Connection
we installed the app serveral times and i think the following lines are per
installation (so per installation it happend on the same page):
org.hibernate.util.JDBCExceptionReporter - Invalid checksum on Page
Page(28,Container(0, 1248)), expected=3'455'715'557, on-disk
version=3'357'396'866,
“Inplace” Compression utility, no disk space is recovered and the size
of the “*.dat” files is not reduced.
That is correct. In-place compression re-arranges the records on
the existing pages of the existing file, gathering the existing
records together and shifting all the free space to be
three operations: purge, defrag, and truncate; when truncate is used, it
releases disk space to the operating system
Oops! My mistake. Sorry about that.
Perhaps the original caller was not passing the TRUNCATE_END parameter
in their call to INPLACE compression. My answer described the
Inns, Jeff wrote:
passed 1 for each operation, which should have turned them on.
I agree, Jeff; passing 1 should have been the correct thing to do.
This is starting to sound like a bug in the TRUNCATE_END feature to me.
thanks,
bryan
The store's metadata thinks that there are 20 columns in the table, and
it only currently supports adding a column at the end of the table. The
request is to add the column at position 16, in the middle. From
I notice that the overall algorithm for adding a column to a table
(in
I was running my test harness code to create a new user. I had a
number of poorly coded sql statements causing exceptions, and eventually
i came to a point where the derby database server gave up.
Make sure that when you catch SQLException and continue running,
that you close the various
Do you have indexes on the important columns of the ASSOCIATION
table? From a quick peek at your query plan, this seems to be
killing you:
Right result set:
Table Scan ResultSet for ASSOCIATION
...
scan information:
Bit set of columns fetched={1, 2}
problems when *reading* from the CLOB.. When I call the
ResultSet.getString on the CLOB I get a IOException thrown, when the
String is large... Is this a known problem?
Might be a resource exhaustion problem. Can you print out the
entire exception stack trace, including all chained exceptions,
Caused by: java.sql.SQLException: An IOException was thrown when reading a
'java.sql.String' from an InputStream.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at
New trace :)
Thanks Ruben!
But we still don't seem to be getting down to the actual IOException.
I'm expecting to see a line that says:
java.io.IOException: ...
with the actual information and the actual stack trace of the
IOException itself, but so far all we've seen is the wrapping
Initialisation consists in writing objects through jpa. After commit is
done, the program starts and reads back those data.
I haven't heard of any problems involving a delay after commit in Derby
itself. Perhaps jpa is not committing the data when you think it is, or
perhaps your program is
I was wondering whether there was a good way to calculate the amount of
space that my derby database is currently using.
There is org.apache.derby.diag.SpaceTable.
This should give you some pointers about how to use it:
sir how i add new table in derby database
and please send me derby gui software or link
You add a new table using the CREATE TABLE statement:
http://db.apache.org/derby/docs/dev/ref/rrefsqlj24513.html
And you can find a number of GUI packages for Derby here:
I didn't want to distribute derbytools.jar with my application. I guess
was looking for something that came with the core jdbc driver.
You could put something together yourself pretty easily:
BufferedReader rdr = ...;
String sql;
Statement stmt = conn.createStatement();
while ( (sql
host and the port. I could successfully ping the Apache Webserver
getting port 80, but not the Derby server.
You don't mention a lot about how you started the network server,
but are you using the -h parameter? Note that, as it says on:
events, and it appears that the problem is that the bulk load CALL
SYSCS_UTIL.SYSCS_IMPORT_DATA (?,?,?,?,?,?,?,?,?) is not entirely
finishing before I try to query the table it is populating. I would
expect to get a locking exception, or something of that nature, but the
I think I would expect
All seems to be going fine but when I shutdown my webapp, the
NetworkServerControl.shutdown() is correctly called but I have db.lck and
dbex.lck left :o(.
I think this may be DERBY-51:
http://issues.apache.org/jira/browse/DERBY-51
Also if I try to restart my webapp, the
shutdown command fails if I try it through a network url (database not
found) or with an embeded url (java.sql.SQLTransientConnectionException:
Database 'ed' shutdown.)
I don't know about the database not found part, but the shutdown command
always throws an exception, so getting Database 'ed'
1 - 100 of 575 matches
Mail list logo