Re: Tree structure query

2005-03-18 Thread Bernt M. Johnsen
Clive Borrageiro wrote (2005-03-18 11:13:49): Hi, I have a table that stores my filesystem entries in a structure that contains parent and child entries and the child entry contains its parent id. Eg. idid_parent path 1 0 c: 2 1 folder1

Re: Multiple SQL statements in a script fail using JDBC

2005-05-25 Thread Bernt M. Johnsen
Andrew wrote (2005-05-24 11:23:07): [snip] How can I give Derby a list of SQL statements from a script and it will execute them, other than me parsing out SQL statement one prior to calling the statement.execute(). From JDBC you can't. You have either to execute the statements one by one,

Re: Derby ClientDriver versus EmbeddedDriver 10.1.1.0 and a question about the Eclipse plugin

2005-08-22 Thread Bernt M. Johnsen
Piet Blok wrote (2005-08-21 17:33:00): Hi, I noticed some different behaviour between Derby EmbeddedDriver and ClientDriver. This was a disappointment, because I wanted to develop a Derby application that may switch between the two drivers. There are some differences between the drivers,

Re: Ability to create a unique index on the same column, doc bug or bug bug?

2005-08-23 Thread Bernt M. Johnsen
Michael J. Segel wrote (2005-08-22 22:16:31): Consider this... You create a table foo, with two columns, bar and retz. bar is an integer, retz is a character string. You populate the table so it looks like this: Foo: BAR RETZ 1 abc 2 def 3 NULL 4 jam ... Now you

Re: Momory leak in JDBC driver?

2005-09-05 Thread Bernt M. Johnsen
[EMAIL PROTECTED] wrote (2005-09-05 10:25:09): Wei Jiang [EMAIL PROTECTED] writes: Hi, I tried Derby using the default JDBC driver and found memory leak. When I use Hsql or Oracle, I do not have such leak. So probably it is the JDBC driver. Two things: 1) Are you closing your

Re: Momory leak in JDBC driver?

2005-09-06 Thread Bernt M. Johnsen
Kathey Marsden wrote (2005-09-05 21:07:55): Bernt M. Johnsen wrote: [EMAIL PROTECTED] wrote Two things: 1) Are you closing your ResultSets? If just let the ResultSet objects pass out of scope without closing them, they will be leaked. That is, the driver keeps a linked list

Re: Are you happy with Derby?

2005-09-09 Thread Bernt M. Johnsen
Michael J. Segel wrote (2005-09-09 13:20:17): The only drawback is that Derby is under GPL. So as long as you follow GPL's rules, you're ok. Derby is under Apache License, Version 2.0. See http://db.apache.org/derby/license.html -- Bernt Marius Johnsen, Database Technology Group, Sun

Re: Equivalent of SQL DROP TABLE IF EXISTS MY_TABLE ?

2005-09-26 Thread Bernt M. Johnsen
[EMAIL PROTECTED] wrote (2005-09-26 18:11:26): Hi there, To initialize my database, I want to use an SQL equivalent of DROP TABLE IF EXISTS MY_TABLE . I've tried it but of course didn't work Does Derby support this kinda SQL or Is there any workaround I can drop a table if it exists

Re: Derby dates

2005-09-26 Thread Bernt M. Johnsen
Nicolas Dufour wrote (2005-09-26 08:16:14): Hello First of all, I would thank the work behind derby : it's a really good product :) Now, I have a little problem to use it with datetime. I have this error : SQL Exception: The syntax of the string representation of a datetime value

Re: how to use schema names , it allways return error for me.

2005-11-06 Thread Bernt M. Johnsen
Legolas Woodland wrote (2005-11-06 14:15:56): Thank you for reply I found a part of problem. 1-SELECT field1, field2 FROM APP.table2 the above statement will never works , i tried to execute it and it return no table found. but the followiing statement works OK . 2-select * from APP.table2

Re: how to use schema names , it allways return error for me.

2005-11-06 Thread Bernt M. Johnsen
Legolas Woodland wrote (2005-11-06 14:15:56): Thank you for reply I found a part of problem. 1-SELECT field1, field2 FROM APP.table2 the above statement will never works , i tried to execute it and it return no table found. but the followiing statement works OK . 2-select * from APP.table2

Re: How to use Unicode with derby ? does it supports unicode text ?

2005-11-06 Thread Bernt M. Johnsen
Legolas Woodland wrote (2005-11-06 17:00:16): Hi Does derby support inserting unicode data into its char variant fields ? for example inserting Arabic ? Yes. in sqlServer there is Ntext and nchar ,nvarchar ... to support unicode data. in mysql there are charset and collat + some connection

Re: how to count total number of records in each group , when using group by statement.

2005-11-28 Thread Bernt M. Johnsen
Answer to both of Legolas' questions: Consider table x with a timestamp field like this: ij select * from x; D -- 2005-11-28 10:26:33.0 2005-11-28 10:26:33.0 2005-11-28 11:26:33.0 2005-11-28 13:26:33.0 2005-11-28 14:26:33.0

Re: how to count total number of records in each group , when using group by statement.

2005-11-28 Thread Bernt M. Johnsen
Correction: Since year(), month() etc is not standard SQL, but scalar functions defined in JDBC/ODBC escape syntax, the portable syntax for this would be: instead of ij select h,count(*) from (select hour(d) from x) as t(h) group by h; write: select h,count(*) from (select {fn hour(d)} from

Re: ij problem?

2005-12-06 Thread Bernt M. Johnsen
Craig L Russell wrote (2005-12-06 10:31:57): Hi Joe, I think your problem is that VARCHAR needs a length, so the ) in the user_password VARCHAR) (at position 161) was unexpected. It expected (20) before the closing ). For the record: VARCHAR without length is a non-standard feature

Re: Get-together at ApacheCon

2005-12-06 Thread Bernt M. Johnsen
David W. Van Couvering wrote (2005-12-06 11:11:12): Hi, all. Many of us will be at ApacheCon in San Diego next week. There is a Derby BoF from 9:30 - 10:30 on Tuesday night. I was thinking that perhaps those of us who are there could meet for an informal, Dutch Treat (meaning we all pay

Re: ij problem?

2005-12-07 Thread Bernt M. Johnsen
Lars Clausen wrote (2005-12-07 09:46:40): On tir, 2005-12-06 at 22:33, Bernt M. Johnsen wrote: Craig L Russell wrote (2005-12-06 10:31:57): Hi Joe, I think your problem is that VARCHAR needs a length, so the ) in the user_password VARCHAR) (at position 161) was unexpected

Re: Selecting first N rows of a result set

2005-12-15 Thread Bernt M. Johnsen
Hi, Please post your SQL and JDBC code. That might make it possible to us to see whay you have performance problems. Generally in JDBC, the way to limit the number of rows returned from a query is stmt.setMaxRows(N). [EMAIL PROTECTED] wrote (2005-12-15 14:46:13): I know this has been asked

Re: How to COUNT DISTINCT over multiple columns ?

2005-12-18 Thread Bernt M. Johnsen
Thomas Dudziak wrote (2005-12-18 12:38:52): SELECT COUNT(*) FROM (SELECT DISTINCT person_id, project_id FROM person_project); doesn't work either, I get a ERROR 42X01: Syntax error: Encountered EOF at line 1, column 80. Is there a way to achieve this with Derby ? You're just

Re: setObject(idx, bigDecimal, Types.NUMERIC); doesn't work ?

2006-01-04 Thread Bernt M. Johnsen
Thomas Dudziak wrote (2006-01-03 17:18:02): Shall I file a JIRA issue then ? I'll do it. -- Bernt Marius Johnsen, Database Technology Group, Staff Engineer, Technical Lead Derby/Java DB Sun Microsystems, Trondheim, Norway pgpAX1dFonA5n.pgp Description: PGP signature

Re: setObject(idx, bigDecimal, Types.NUMERIC); doesn't work ?

2006-01-04 Thread Bernt M. Johnsen
Thomas Dudziak wrote (2006-01-03 17:18:02): On 1/2/06, Bernt M. Johnsen [EMAIL PROTECTED] wrote: Thomas Dudziak wrote (2005-12-25 16:18:14): When executing this code snippet: Statement stmt = conn.createStatement(); stmt.executeUpdate(CREATE TABLE test (\n

Re: setObject(idx, bigDecimal, Types.NUMERIC); doesn't work ?

2006-01-06 Thread Bernt M. Johnsen
Craig L Russell wrote (2006-01-05 16:59:00): Hi, I asked Lance Anderson, spec lead for JDBC 4.0, about this issue and he replied that he thinks that due to compatibility with existing applications that rely on this behavior, it's unlikely to change. My opinion is that the behavior is

Re: Removing Derby tagline

2006-01-26 Thread Bernt M. Johnsen
+1 for removing the tagline +1 for putting it back later when Sun figures we can -- Bernt Marius Johnsen, Database Technology Group, Staff Engineer, Technical Lead Derby/Java DB Sun Microsystems, Trondheim, Norway signature.asc Description: Digital signature

Re: Finding length of a result set

2006-01-31 Thread Bernt M. Johnsen
I would suggest you use the SQL COUNT() function (in the same transaction). E.g. stat = con.prepareQuery(select * from myView where username='foo') count_stat = con.prepareQuery(select count(*) from myView where username='foo'); ResultSet count_res = stat2.executeQuery();

Re: Finding length of a result set

2006-02-01 Thread Bernt M. Johnsen
I apologize for this mail. At last I have learned (once again) to read the whole mail before I answr. At least Craig sent a decent replay. Thanks Craig. Sorry John. Bernt M. Johnsen wrote (2006-01-31 09:56:34): I would suggest you use the SQL COUNT() function (in the same transaction). E.g

Re: Can some one compare Ingres 2006 and Derby ?

2006-02-13 Thread Bernt M. Johnsen
Legolas Woodland wrote (2006-02-14 01:21:39): Hi Thank you for reading my post. Today Ingres announced its Ingres 2006 , Can some one do a fast or in depth comparison between this two product? Fast comparision: Derby is Java Derby may be embedded Not so fast comparision: An

Re: Driver not capable

2006-02-16 Thread Bernt M. Johnsen
Software wrote (2006-02-17 00:34:02): Hi all, I tried to insert a new row into a table with the following code: [code] protected void insertField(ArrayList field) throws SQLException { try { Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,

Re: Using/Adressing a row number in a SELECT query

2006-02-17 Thread Bernt M. Johnsen
Sylvain RICHET wrote (2006-02-17 11:55:37): Thanks Legolas, ... but limiting the fetch size by JDBC API supported methods (setFetchSize) implies that i have already loaded ALL records from database, no ? setFetchSize is an optimization hint to the driver/database and will not affect the

Re: ResultSet.getInt()

2006-02-22 Thread Bernt M. Johnsen
I think your answer lies in the description of wasNull() boolean wasNull() throws SQLException Reports whether the last column read had a value of SQL NULL. Note that you must first call one of the getter methods on a column to try to read its value and then call

Re: SQL Exception

2006-03-01 Thread Bernt M. Johnsen
Hi, You are calling setObject(null) and should have called setNull(...) There is a big difference between Java null (an empty reference) and SQL NULL (an undefined value). meenakshi selvi wrote (2006-03-01 05:26:59): hi all, i have created a table in derby as follow create table

Re: Where i can find sql-99 and sql-2003 standard ?

2006-03-04 Thread Bernt M. Johnsen
Legolas Woodland wrote (2006-03-04 16:55:47): Bernt M. Johnsen wrote: Legolas Woodland wrote (2006-03-04 13:38:00): Hi Thank you for reading my post. where i can find sql-99 and sql-2003 standards ? author has use them in his paper. http://wiki.apache.org/db

Re: Derby foreign key ON UPDATE clause problem

2006-04-06 Thread Bernt M. Johnsen
Kristian Waagan wrote (2006-04-06 10:27:13): Glenn Marintes wrote: Hi All, ij CREATE TABLE Seal ( sealId BIGINT NOT NULL, sealFilename VARCHAR(512), sealCode VARCHAR(64) NOT NULL, sealName VARCHAR(256) NOT NULL, sealGroupFK BIGINT NOT NULL, PRIMARY KEY(sealId), FOREIGN KEY

Re: Derby foreign key ON UPDATE clause problem

2006-04-06 Thread Bernt M. Johnsen
Bernt M. Johnsen wrote (2006-04-06 10:40:46): Yes. SQL Feature F701 Referential update actions is only partially implemented. See http://wiki.apache.org/db-derby/SQLvsDerbyFeatures You could also provied some details in the Note field on the wiki-page ;-) Another comment: F701

Re: Problems assigning null to VARCHAR FOR BIT DATA types

2006-04-10 Thread Bernt M. Johnsen
Wynne Crisman wrote (2006-04-09 17:25:17): Is it possible to assign a null value to a VARCHAR FOR BIT DATA column? I am getting the following exception from the derby driver: SQL Exception: An attempt was made to get a data value of type 'VARCHAR () FOR BIT DATA' from a data value of type

Re: Is there any plan for a newer release for derby ?

2006-04-27 Thread Bernt M. Johnsen
10.1.2.3 Snapshot release was made available on March 7 (See the download page). 10.1.3 is planned for June 28: See http://wiki.apache.org/db-derby/TenOneThreeRelease There's also an ongoing discussion on a feature release (10.2) after the summer. See the discussions on derby-dev. Legolas

Re: How should trailing spaces be treated in key fields

2006-05-04 Thread Bernt M. Johnsen
Stanley Bradbury wrote (2006-05-03 16:21:08): Steve Bosman wrote: Hi, The application I'm writing is copying records from an Oracle database to a Derby database and today I have been getting error 23505 (showing a primary key constraint violation) when two records have a key value

Re: generated by default question

2006-05-30 Thread Bernt M. Johnsen
Michael Segel wrote (2006-05-30 13:09:19): The issue that we see is that Derby barfs when it hits a row that was inserted without using the identity value, and Derby doesn't know how to generate the next identity value. That sir, is a bug. And no, the SQL 2000 spec, as presented in this

Re: generated by default question

2006-05-30 Thread Bernt M. Johnsen
Bernt M. Johnsen wrote (2006-05-30 20:20:48): I have not studied this well enough to conclude wether Derby's current behaviour is compliant with the SQL 2000 spec or not. But there is nothing in the Derby charter that requires Derby to be SQL 2000 compliant, so if you're right, Derby

Re: Column 'XXXX' is not in any table in the FROM list....

2006-05-30 Thread Bernt M. Johnsen
Alexandre Gomes wrote (2006-05-30 16:27:20): Take a look at this screenshot. The SQL statement is quite simple select texto from ACORDAO. On the left, you can see ACORDAO table and its 'texto' column. Am I so tired that I cannot see the problem? try select texto from acordao; Note that SQL

Re: JMX Extensions to Derby

2006-06-01 Thread Bernt M. Johnsen
Øystein Grøvlen wrote (2006-06-01 09:24:18): Sanket Sharma wrote: I would also appreciate your suggestions on features the community would like to see being implemented as JMX extensions. On the top of my head: - Performancs statistics (e.g., transactions committed/aborted per second)

Re: JMX Extensions to Derby

2006-06-02 Thread Bernt M. Johnsen
I suggest that the distributed services level should be optional. Only the agent level and the instrumentation level should be there by default. This will also comply with the current Derby architecture with embedded vs. the network server. Let me restate to make sure I understand what

Re: A truncation error was encountered tryin,g to shrink BLOB 'XX-RESOLVE-XX' to length 1048576.

2006-06-07 Thread Bernt M. Johnsen
Daniel John Debrunner wrote (2006-06-06 14:39:56): Farrukh Najmi wrote: Daniel John Debrunner wrote: You probably created the table without specifying a length on BLOB, this defaults to BLOB(1M). You need to use BLOB(2G). e.g. create table T (a int, b BLOB(2G)) A bug about this

Re: generated by default question

2006-06-12 Thread Bernt M. Johnsen
Well, I'm the one that doesn't accept this as a bug/defect since Derby behaves according to the SQL standard. My stand is based on the chapters 4.14.17 and 9.21 in the SQL 2003 (INCITS/ISO/IEC 9075-2-2003 Information technology - Database languages - SQL - Part 2: Foundation (SQL/Foundation)), see

Re: generated by default question

2006-06-14 Thread Bernt M. Johnsen
Let me clearify some items from the SQL 2003 standard related to the latest mails regarding this issue from Craig and Michael: 1) In the case of generated always, it should not be possible to insert explicit values in identity columns, nor to alter generated values. 2) Internal and

Re: generated by default question

2006-06-15 Thread Bernt M. Johnsen
Michael Segel wrote (2006-06-14 09:23:45): 6) I can find no relation, whatsoever, defined in the standard between the existing values in a column and how the internal sequence generator of an identity column behaves. [mjs] Correct. Nor would you. That gap is left to the

Re: Working set memory usage

2006-08-09 Thread Bernt M. Johnsen
Clive Borrageiro wrote: Hi, When I use derby as an embedded database that contains a large amount of records (in excess of 100,000), the Working set memory (as seen under Windows Task Manager Mem Usage) of the application's process grows with time usage. I created a simple test

Re: How to modify the SQLParser to handle NULL in column definitions ?

2006-08-10 Thread Bernt M. Johnsen
Hi, This is a developer question which should be posted on derby-dev. Anyway, although I know there are databases which allow you to specify nullability by the keyword NULL (which is redundant since columns are nullable unless given a NOT NULL constraint), this is *not* a part of the SQL

Re: case insensitive searches

2006-08-10 Thread Bernt M. Johnsen
Hi, Edson Carlos Ericksson Richter wrote: Is not possible to create a index based on function results? Not for the moment. It is proposed as a new feature (https://issues.apache.org/jira/browse/DERBY-455), but I don't think anyone is working on it presently. Regards, Richter

Re: SQL Parser failing on NULL column contraint

2006-08-31 Thread Bernt M. Johnsen
I can't see any reason why anyone would spend time on this issue. 1) NULL is not a constraint. All columns are nullable by default (SQL standard and in all SQL databases to my knowledge). 2) It will not add any new functionality. 3) You will not gain anything in speed, resource usage etc.

Re: multiple network cards

2006-09-05 Thread Bernt M. Johnsen
You will find all the details you need in Derby Server and Administration Guide Quote (on derby.drda.host): If the property is set to 0.0.0.0, Network Server will listen on all interfaces. [EMAIL PROTECTED] wrote: Hi, I am in need of some information on the following scenario. Scenario:

Re: Alias problem in SELECT with HAVING clause

2006-09-08 Thread Bernt M. Johnsen
Robert Enyedi wrote: For the following database structure: CREATE TABLE users ( id INT PRIMARY KEY, email VARCHAR(64) ); CREATE TABLE notification ( id INT PRIMARY KEY, user_id INT, count INT NOT NULL ); I use this query: SELECT users.email, users.id AS user_id

Re: ENUM

2006-09-08 Thread Bernt M. Johnsen
Dan Scott wrote: On the SET datatype: Even the MySQL docs include a section upfront called Why you shouldn't use SET (http://dev.mysql.com/tech-resources/articles/mysql-set-datatype.html). It's not an atomic datatype. Bad. On ENUM: The SQL standard way of doing the equivalent of ENUM, and

Re: java.sql.SQLRuntimeException: Cannot store DataSet instance to WeakHashMap

2006-09-11 Thread Bernt M. Johnsen
Hi all This is a JDK6 b98 problem, and not related to Derby. Bernt [EMAIL PROTECTED] wrote: The following message is a courtesy copy of an article that has been posted to comp.lang.java.databases as well. I'm cc'ing this reply to derby-user@db.apache.org, since not many derby people

Re: DROP IF NOT EXISTS

2006-09-14 Thread Bernt M. Johnsen
yves pielusenet wrote: I wonder if there is something similare like : 'drop index id_index if not exists' ? I want to put a condition on a drop statement but it fails. how can I do ? You could do it like this: try { stmt.executeUpdate(drop index id_index); } catch (SQLException e) {

Re: Top 1 - Limit 1

2006-09-16 Thread Bernt M. Johnsen
Tim Dudgeon wrote: Marl Atkins wrote: This would only work if the ID field is an Identity. As it happens, it IS so this should work for me too. THREE answers to my problem. You guys are good THANKS!! Yes, but is there an equivalent to the TOP or LIMIT keywords that other

Re: Top 1 - Limit 1

2006-09-16 Thread Bernt M. Johnsen
Tim Dudgeon wrote: Bernt M. Johnsen wrote: Tim Dudgeon wrote: Yes, but is there an equivalent to the TOP or LIMIT keywords that other databases use? Not in SQL (neither in Derby nor the SQL standard). The closest equivalent is Statement.setMaxRows(i). So that would

Re: read-only database in a web application?

2006-09-22 Thread Bernt M. Johnsen
David Harrigan wrote: Hi, The ongoing learning adventure continues! :D My database is built, now I've jar'ed it up thusly: searchdb.jar contains: searchdb/seq0 serachdb/seq0/.. searchdb/log.. searchdb/log/.. etc... Now, I've dropped this jar into the

Re: Unicode support

2006-09-25 Thread Bernt M. Johnsen
Ninad Agate wrote: Does Derby 10.1 support UTF-8 and UTF-16 encodings? I have not been able to find this information in the reference docs. Thanks. Derby supports Unicode for CHAR,VARCHAR,CLOB etc. Data is stored in UTF-8 on disk, and transferred between network client and server in UTF-8.

Re: how to make a replication between mysql and derby?

2006-09-27 Thread Bernt M. Johnsen
Hi, You could also check out C-JDBC (http://c-jdbc.objectweb.org/) and especially this document: http://c-jdbc.objectweb.org/current/doc/C-JDBC_horizontal_scalability.pdf -- Bernt Marius Johnsen, Database Technology Group, Staff Engineer, Technical Lead Derby/Java DB Sun Microsystems,

Re: What is correct way of closing an embedded connection ?

2006-10-31 Thread Bernt M. Johnsen
legolas wood wrote (2006-10-31 01:53:52): Hi Thank you for reading my post what is proper way of closing a connection when we use an embedded Derby database? connection.close(); is it ok if we create several connection against an Embedded Derby , yes how will be the resource

Re: slow subqueries

2006-11-11 Thread Bernt M. Johnsen
Jim Newsham wrote (2006-11-11 10:07:18): 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

Re: [OT] Two suggestions on list management...

2006-11-13 Thread Bernt M. Johnsen
[EMAIL PROTECTED] wrote (2006-11-13 08:10:55): Has anyone else noticed an increase in Spam? Yes. I'm running a server with several mailing lists (completely unrelated to any Apache project whatsoever), and have had a notiecable increase in spam attacks on list-adresses lately. I solved the

Re: [OT] Two suggestions on list management...

2006-11-13 Thread Bernt M. Johnsen
The rest of this mail should be directed to [EMAIL PROTECTED] [FYI] Since only comitters are allowed to mail on [EMAIL PROTECTED], I forwarded your mail there. -- Bernt Marius Johnsen, Database Technology Group, Staff Engineer, Technical Lead Derby/Java DB Sun Microsystems, Trondheim, Norway

Re: [OT] Two suggestions on list management...

2006-11-14 Thread Bernt M. Johnsen
Bernt M. Johnsen wrote (2006-11-13 23:12:04): The rest of this mail should be directed to [EMAIL PROTECTED] [FYI] Since only comitters are allowed to mail on [EMAIL PROTECTED], I forwarded your mail there. Reply from infrastructure: For example, the Dovecot mailing list will include

Re: Limiting select results

2006-11-27 Thread Bernt M. Johnsen
Charlie Babitt wrote (2006-11-25 14:53:23): Hallo! How can I limit the maximum rows that are returned in a select in apache derby? select * from table LIMIT 10; (as it works in postgres) gives me a syntax error at 10 Any help would be great... What about statement.setMaxRows(10)

Re: Use SQL parsing

2006-11-29 Thread Bernt M. Johnsen
Flavio Palumbo wrote (2006-11-29 09:11:10): Hi all, maybe a bit OT ... but I'd like to use the SQL parsing engine of Derby ; my goal is to validate a string to say it's a correct SQL statement, before to execute it. Is it possible with no headache ?? The easiest way is to do

Re: (10.1.1.0) Cannot close active connection

2006-12-06 Thread Bernt M. Johnsen
Xanana, It could be that you're hitting https://issues.apache.org/jira/browse/DERBY-2084 or https://issues.apache.org/jira/browse/DERBY-638 Bernt Xanana Gusmao wrote (2006-12-06 09:26:40): Kristian, In terms of upgrading, I will come back to you later on that. This is a production system

Re: unique columns must be nullable ?

2006-12-12 Thread Bernt M. Johnsen
Xanana Gusmao wrote (2006-12-12 04:08:39): On this page http://wiki.apache.org/db-derby/HibernateHelp it says: Hibernate Annotations do not work because Derby does not allow a unique column to be nullable Is this (that Derby's unique column must be non-nullable) still true ? That's

Re: Derby row locking semantic

2007-01-18 Thread Bernt M. Johnsen
Mamta Satoor wrote (2007-01-18 13:54:28): Hi, I might be showing my ignorance here but will probably learn in the process. I looked at http://db.apache.org/derby/docs/10.2/devguide/cdevconcepts15366.html and found under Table 3 that for TRANSACTION_READ_COMMITTED, it is possible to see

Re: Derby and 2007 Extended DST

2007-01-25 Thread Bernt M. Johnsen
Darryl Bowler wrote (2007-01-25 14:33:13): Does anyone know if Derby is affected by this years Extended Daylight Saving Time? If so, is there a fix? Derby is indirectly affected through the Java VM. If the VM is correct, then Derby will behave correctly. You will have to check out the VM

Re: Derby and 2007 Extended DST

2007-01-27 Thread Bernt M. Johnsen
Bernt M. Johnsen wrote (2007-01-25 22:08:28): Darryl Bowler wrote (2007-01-25 14:33:13): Does anyone know if Derby is affected by this years Extended Daylight Saving Time? If so, is there a fix? Derby is indirectly affected through the Java VM. If the VM is correct, then Derby

Re: Date Arithmetic - Add 5-day DURATION to CURRENT_DATE

2007-01-31 Thread Bernt M. Johnsen
Anders Morken wrote (2007-01-31 15:49:46): Sisilla: How do I insert a date value of 5 days after the current date to a column called 'responseDate' in a table called 'quotationRequest'? Perhaps, it would be similar to the following?-: INSERT INTO quotationRequest (responseDate) VALUES

Re: Derby fully sql-2003 compliant?

2007-02-01 Thread Bernt M. Johnsen
[EMAIL PROTECTED] wrote (2007-02-01 19:15:16): Christian Lang [EMAIL PROTECTED] writes: Hi, I'm trying to understand which SQL language subset Derby is using. I installed version 10.2.2.0 and tried to compile and execute the following statement: SELECT MIN(A) OVER

Re: Atomic check for row existence and insert if doesn't exist

2007-02-10 Thread Bernt M. Johnsen
Ace Jayz wrote (2007-02-09 21:08:44): I've got a table with an identity column, P, as a primary key. This table has another column, C, with a uniqueness constraint. I want to insert a row into the table if no row has a value for C=c, and if a row does exist whose column C=c I want to get

Re: Atomic check for row existence and insert if doesn't exist

2007-02-14 Thread Bernt M. Johnsen
Hi, Ace Jayz wrote (2007-02-12 09:50:22): Ace Jayz wrote: If REPEATABLE READ is in effect, then no other transaction would be able to delete the row between the insert and the select because this would result in different results for the select statement if it were repeated.

Re: prepared statements

2007-02-26 Thread Bernt M. Johnsen
Hi, This behaviour is defined in the JDBC specification. Amir Michail wrote (2007-02-26 14:46:33): Hi, Why is it that prepared statements are created with respect to a connection? Why can't you share a prepared statement across connections? Amir -- Bernt Marius Johnsen, Database

Re: Does derby support bitwise operators in SQL?

2007-03-02 Thread Bernt M. Johnsen
Hi, Imran Hussain wrote (2007-03-02 10:02:11): Dan, Thanks for the response. I wonder if there is any plan to add support for this in the future? Not as far as I know, but this is a open source project, and as such this will not be implemented unless someone feels the itch to do so. You

Re: profiling the derby code: statement compiler is sub-par

2007-03-07 Thread Bernt M. Johnsen
Hi, With this result i would guess that you do something like (Derby is compiling a new statement for each iteration): Statement s = conn.createStatement(); for (int i=0;i200;i++) { s.executeUpdate(insert into data values(+i+,.)); } Try something like PreparedStatement s =

Re: How to execute optimizer overrides in a java app

2007-03-10 Thread Bernt M. Johnsen
I think this discussion is another arument for https://issues.apache.org/jira/browse/DERBY-1749 Then an example could be ResultSet rs = s.executeQuery( SELECT num, addr FROM derbyDB /*derby-properties index=IDX1*/ order by num); while SELECT num, addr FROM derbyDB /*derby-properties

Re: Problem in release connection

2007-03-21 Thread Bernt M. Johnsen
Hi, Maybe it would help to close the prepared statement befor you close the connection, which also would be the natural way of cleaning up. Bernt Shambhu wrote (2007-03-21 18:55:29): Hi, I am using Cloudscape(IBM Cloudscape Version 10.1) and derbyclient.jar provided by derby. Following

Re: Help reading transaction logs

2007-05-03 Thread Bernt M. Johnsen
Hi, Don't know why you get a null result, it might be that you should position after some preamble or something like that. But, I'm curious about what you really want to achieve? There might be better ways to do it than reading the transaction log. Bernt Andy Stewart wrote (2007-05-03

Re: Insert JAVA_OBJECT in embedded Derby DB

2007-05-04 Thread Bernt M. Johnsen
You need to serialize the object. One way of doing it is like this: ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(bos); oos.writeObject(item); oos.close(); ps.setBytes(1, bos.toByteArray()); An

Re: maxrows - what does it really mean?

2007-05-14 Thread Bernt M. Johnsen
What David wants, is the feature rgistered in https://issues.apache.org/jira/browse/DERBY-581 Craig L Russell wrote (2007-05-13 12:06:38): Also, how is maxrows related to the fetch size of a ResultSet? As I understand it, the fetch size relates to the number of rows returned by the server

Re: maxrows - what does it really mean?

2007-05-14 Thread Bernt M. Johnsen
operations http://wiki.apache.org/db-derby/SQLvsDerbyFeatures), Thanks, David On 5/14/07, Bernt M. Johnsen [EMAIL PROTECTED] wrote: What David wants, is the feature rgistered in https://issues.apache.org/jira/browse/DERBY-581 Craig L Russell wrote (2007-05-13 12:06:38): Also, how

Re: maxrows - what does it really mean?

2007-05-14 Thread Bernt M. Johnsen
David Van Couvering wrote (2007-05-14 13:11:00): Thanks for the tip, Bernt, but I must humbly say yuck! to the syntax. OK, getting over that, it's pretty worthless to me given that Derby doesn't use it and Derby is the primary DB used by NetBeans. But let's say it was implemented -- would

Re: maxrows - what does it really mean?

2007-05-14 Thread Bernt M. Johnsen
Lance J. Andersen wrote (2007-05-14 16:38:03): Also, there are not a lot of DBs that support that syntax... :-( As far as I know, it's supported by DB2, MSSQL and Oracle (not quite pretty close anyway). MySQL and PostgreSQL has this non-standard LIMIT/OFFSET stuff. -- Bernt Marius Johnsen,

Re: maxrows - what does it really mean?

2007-05-16 Thread Bernt M. Johnsen
David Van Couvering wrote (2007-05-15 10:10:52): I can imagine myself writing a nice little API that sets the offset limit, and then have a pluggable implementation for each of the drivers. But of course, that's what JDBC is supposed to do for me :) I have suggested for next the JDBC version

Re: What is the UPDATE syntax for using two tables?

2007-05-25 Thread Bernt M. Johnsen
[EMAIL PROTECTED] wrote (2007-05-25 09:29:23): Luan O'Carroll [EMAIL PROTECTED] writes: I have a SQL Server query that I am trying to port to Derby but I can't find the right syntax. Is there any documentation? The SQLServer query is: UPDATE TEMP_RATES SET Level1=RATES.Level1

Re: What is the UPDATE syntax for using two tables?

2007-05-29 Thread Bernt M. Johnsen
Luan O'Carroll wrote (2007-05-28 09:18:22): The SQL given is for SQLServer and I can't find the correct SQL for Derby, the problem being that Derby doesn't support the FROM clause in an UPDATE statement. I've tried the following: UPDATE TEMP_RATES SET TEMP_RATES.Level1=RATES.Level1

Re: Connection refused

2007-06-06 Thread Bernt M. Johnsen
Hi, Steve Pannier wrote (2007-06-05 10:28:18): Hi all. I'm trying to access the network server using the network client driver. I connect to my database from a remote client and keep getting the connection refused error. Even when I connect from the local system, I get the error (in

Re: securityMechanism for network client - can't make it work

2007-06-15 Thread Bernt M. Johnsen
M. Johnsen [EMAIL PROTECTED] wrote: Hi, Are you sure you use Derby 10.2.1.6 or newer? The error response seems to indicate an earlier version. Bernt David Van Couvering wrote (2007-06-15 12:12:38): OK, I'm completely flummoxed. I am trying to use strong password mechanism instead

Re: securityMechanism for network client - can't make it work

2007-06-15 Thread Bernt M. Johnsen
it say this is what you need to do. I'll log a bug for that too. There is support for mnemonics... just use STRONG_PASSWORD_SUBSTITUTE_SECURITY instead of 8. David On 6/15/07, Bernt M. Johnsen [EMAIL PROTECTED] wrote: Well the server is new enough, but what about the client. Look here

Re: securityMechanism for network client - can't make it work

2007-06-15 Thread Bernt M. Johnsen
Bernt M. Johnsen wrote (2007-06-16 00:39:02): David Van Couvering wrote (2007-06-15 15:21:28): Thanks, Bernt, that was it. BTW, 8 is not a very helpful property value. It makes me feel like I'm in a COBOL or Fortran shop. We should add support for mnemonics, rather than just

Re: User/password encryption and deployment

2007-06-16 Thread Bernt M. Johnsen
Michael Segel wrote (2007-06-16 00:23:56): Which is why I'm a little suspect that the *only* way to do encryption on the wire is to be forced to bring in IBM's JCE. You don't need the IBM JCE. Sun's JDK comes with and JCE which works just fine. The docs tries to tell you that if you use an old

Re: User/password encryption and deployment

2007-06-16 Thread Bernt M. Johnsen
[EMAIL PROTECTED] wrote (2007-06-16 07:53:55): [...] There is, however small issue, if you choose ENCRYPTED_USER_AND_PASSWORD_SECURITY, newer Sun JCE's (from 1.4, I think) does not support the shared DHS value defined in the DRDA protocol. It's too weak. As an alternative solution for

Re: User/password encryption and deployment

2007-06-17 Thread Bernt M. Johnsen
Bernt M. Johnsen wrote (2007-06-16 18:43:51): [EMAIL PROTECTED] wrote (2007-06-16 07:53:55): [...] There is, however small issue, if you choose ENCRYPTED_USER_AND_PASSWORD_SECURITY, newer Sun JCE's (from 1.4, I think) does not support the shared DHS value defined in the DRDA

Re: User/password encryption and deployment

2007-06-18 Thread Bernt M. Johnsen
David Van Couvering wrote (2007-06-17 18:14:38): Oh, I get it now, 10.3 will add support for SSL. But this will encrypt all network traffic. If you just want to encrypt the password, you have to use the existing password encryption functionality (either ENCRYPT or STRONG SUBSTITUTION),

Re: REPLACE INTO/INSERT IF NOT EXIST

2007-06-19 Thread Bernt M. Johnsen
Hi, Kurt Huwig wrote (2007-06-19 10:46:09): Hi, I am using HA-JDBC as a clustering solution and having a problem with exceptions due to duplicate keys. The application is multi-threaded, multi-JVM and needs to insert records into a table if they do not exist yet. It is possible, that

Re: REPLACE INTO/INSERT IF NOT EXIST

2007-06-19 Thread Bernt M. Johnsen
Kurt Huwig wrote (2007-06-19 12:34:38): Am Dienstag, 19. Juni 2007 schrieb Bernt M. Johnsen: Kurt Huwig wrote (2007-06-19 10:46:09): Unfortunately, both are not an option for me due to the way HA-JBDC works: it sends every SQL-update statement to every node. If it succeeds on one

Re: Characters and bytes

2007-06-19 Thread Bernt M. Johnsen
Williamson, Nick wrote (2007-06-19 11:09:34): Hi all, In Oracle, you can specify character columns widths in bytes (the default) or characters. The advantage of specifying column width in characters is that you can attempt to store - say - 10 multi-byte characters in a VARCHAR(10) column

  1   2   >