Re: should Clob.getSubstring() allow length of 0?

2006-07-17 Thread Thomas Dudziak
On 7/17/06, Lance J. Andersen [EMAIL PROTECTED] wrote: Here is the description of String.subString() substring public String substring(int beginIndex, int endIndex) Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the

Re: Proposal for 10.2 release schedule

2006-06-26 Thread Thomas Dudziak
On 6/24/06, Daniel John Debrunner [EMAIL PROTECTED] wrote: Thomas Dudziak wrote: On 6/22/06, Rick Hillegas [EMAIL PROTECTED] wrote: Last week, Sun Microsystems announced that it will bundle Derby with the next major release of the reference jdk, Java SE 6, also known as Mustang or jdk1.6

Re: Derby copyright questions (was Re: Proposal for 10.2 release schedule)

2006-06-26 Thread Thomas Dudziak
Hi Jean, On 6/26/06, Jean T. Anderson [EMAIL PROTECTED] wrote: The original Software Grant provides an ASF record of the files that were originally contributed -- as does the subversion repository itself, which provides a record of both the files that were contributed originally and the files

Re: Proposal for 10.2 release schedule

2006-06-24 Thread Thomas Dudziak
On 6/22/06, Rick Hillegas [EMAIL PROTECTED] wrote: Last week, Sun Microsystems announced that it will bundle Derby with the next major release of the reference jdk, Java SE 6, also known as Mustang or jdk1.6. If you download the latest Mustang build, you will see that it contains our Derby

Re: The tutorial on migrating DB to derby

2006-06-15 Thread Thomas Dudziak
On 6/15/06, Kathey Marsden [EMAIL PROTECTED] wrote: The problem was just that ddlutils was not handling the case where the lob length was 0, but it was not null (an empty string was in the CLOB column) The hack of a patch below got me going. Mhmm, the Clob Javadoc does not explicitly state

Re: The tutorial on migrating DB to derby

2006-06-15 Thread Thomas Dudziak
On 6/15/06, Kathey Marsden [EMAIL PROTECTED] wrote: Please note, my hack of a patch is not ready and needs adjustment. It calls Clob.length() twice which may be a performance issue on some systems and I haven't tested it with BLOB's and looking at the code now I see it is flat out wrong.

Re: The tutorial on migrating DB to derby

2006-06-14 Thread Thomas Dudziak
On 6/14/06, Kathey Marsden [EMAIL PROTECTED] wrote: snip Caused by: SQL Exception: Zero or negative length argument '0' passed in a BLOB or CLOB method. at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:80) at

Re: Using DdlUtils to Migrate Databases to Derby (MySQL-to-Derby)

2006-03-12 Thread Thomas Dudziak
On 3/13/06, Thomas J. Taylor [EMAIL PROTECTED] wrote: I tried running DDLUtils to convert one of our existing MySQL databases to Derby. It got to the point of importing data from the data.xml file but failed due to an 'Data Truncation' Exception converting from LONG VARCHAR to VARCHAR(32700).

Re: Using DdlUtils to Migrate Databases to Derby (MySQL-to-Derby)

2006-03-12 Thread Thomas Dudziak
On 3/13/06, Thomas J. Taylor [EMAIL PROTECTED] wrote: By the way, it looks like the DDLUtils failed on a MySQL LONG VARCHAR that we represent as a CLOB in Derby. Typically, the column content includes very long XML content. Could you provide the SQL for the table where DdlUtils failed ? Which

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

2006-01-05 Thread Thomas Dudziak
On 1/4/06, Bernt M. Johnsen [EMAIL PROTECTED] wrote: I was too fast in my conclusions. It is not a bug. setObject(idx, bigDecimal, Types.NUMERIC) is defined to be identical with setObject(idx, bigDecimal, Types.NUMERIC, 0) and that's exactly what Derby does. If you need decimals, you have

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

2006-01-03 Thread Thomas Dudziak
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+ pk INTEGER NOT NULL,\n

Re: What is wrong with this sql script , im sure that it is ok , but derby return error.

2006-01-02 Thread Thomas Dudziak
On 1/2/06, Legolas Woodland [EMAIL PROTECTED] wrote: Thank you for reading my post. can some one please check and see what is wrong with this scripts ? im sure that they should execute but derby return errors like : org.apache.derby.client.am.SqlException: Constraints 'SQL060103004635123'

Re: What we should use instead of boolean type which is not availabe in derby ?

2006-01-02 Thread Thomas Dudziak
On 1/2/06, Legolas Woodland [EMAIL PROTECTED] wrote: Thank you for reading my post. what type i should use instead of boolean in derby ? should i use tinyint / small int for this purpose ? Yep, ResultSet.getBoolean/setBoolean work just fine with these types, so in your Java code you can use

Re: Default value for (VAR)CHAR FOR BIT DATA columns ?

2005-12-27 Thread Thomas Dudziak
On 12/27/05, Daniel John Debrunner [EMAIL PROTECTED] wrote: Yes. Use literals/constants that represent VARCHAR FOR BIT DATA. create table t ( b varchar(20) for bit data default X'CAFE') The default here would be 0xCAFE Yes, I thought it would be something like that (without the X though).

Re: Default value for (VAR)CHAR FOR BIT DATA columns ?

2005-12-27 Thread Thomas Dudziak
On 12/28/05, Daniel John Debrunner [EMAIL PROTECTED] wrote: The value is hex, not ASCII characters. Two characters, each in the range 0-F represent a single byte. Ah, cool. I thought you wanted to write 'CAFE' as in: cafe :-) Tom

Default value for (VAR)CHAR FOR BIT DATA columns ?

2005-12-26 Thread Thomas Dudziak
Hi there, I'd like to specify a default value for a (VAR)CHAR FOR BIT DATA columns when creating a table. Is this possible with Derby, even if the default value contains unprintable (non-ascii) characters ? regards, Tom

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

2005-12-25 Thread Thomas Dudziak
When executing this code snippet: Statement stmt = conn.createStatement(); stmt.executeUpdate(CREATE TABLE test (\n+ pk INTEGER NOT NULL,\n+ value NUMERIC(15,7) NOT NULL,\n+ PRIMARY KEY (pk)\n+ ));

Re: How to COUNT DISTINCT over multiple columns ?

2005-12-19 Thread Thomas Dudziak
Don't think many databases has implemented COUNT(row value expression) although it has been in the SQL standard since '92. COUNT(DISTINCT col) works, though May be, yes. Would be nice though if Derby supports more than one column in the COUNT DISTINCT inner expression. But the COUNT(*) on a

Re: How to COUNT DISTINCT over multiple columns ?

2005-12-18 Thread Thomas Dudziak
On 12/18/05, Bernt M. Johnsen [EMAIL PROTECTED] wrote: You're just missing a small detail: select count(*) from (select distinct person_id, project_id from person_project) as t(a,b); Yup, thanks, that works! But is there any chance for support for SELECT COUNT(DISTINCT person_id,

Re: Possible bug in PreparedStatement ?

2005-12-12 Thread Thomas Dudziak
On 12/11/05, Daniel John Debrunner [EMAIL PROTECTED] wrote: Thomas Dudziak wrote: While sitting here with Jean at the Hackathon and adding support for Derby to OJB, I stumbled across a strange exception that might perhaps be a bug. In short, OJB generates some SQL like this (don't ask

Re: derby.war not working

2005-12-12 Thread Thomas Dudziak
On 12/12/05, Myrna van Lunteren [EMAIL PROTECTED] wrote: I always thought derby.war was only supposed to have the web.xml in it. The web.xml refers to org.apache.derby.drda.NetServlet which lives in derbynet.jar. You're supposed to make the derbynet.jar available to the app server's

Possible bug in PreparedStatement ?

2005-12-11 Thread Thomas Dudziak
While sitting here with Jean at the Hackathon and adding support for Derby to OJB, I stumbled across a strange exception that might perhaps be a bug. In short, OJB generates some SQL like this (don't ask): SELECT A0.TASK_ID,A0.PERSON_ID,A0.PROJECT_ID,A0.TASKNAME FROM TASK A0 WHERE (A0.PERSON_ID =

Re: Why are classpath databases always read-only ?

2005-12-10 Thread Thomas Dudziak
On 12/10/05, Michael Segel [EMAIL PROTECTED] wrote: So, coding is now ugly? No, it simply should not necessary in this case, configuration would suffice. And I would have to code it whenever I want to have this functionality, so I would have to come up with solutions for, say, Spring, for EJB,

Re: Why are classpath databases always read-only ?

2005-12-09 Thread Thomas Dudziak
On 12/9/05, Lance J. Andersen [EMAIL PROTECTED] wrote: There is no requirement that an app can write to the directory where the internal version of a web app is stored in an app server Sure, I'm aware that there neither has to be a directory or it is not writeable. But in a lot of cases it is,

Re: Why are classpath databases always read-only ?

2005-12-09 Thread Thomas Dudziak
Beauty is in the eye of the beholder. How is determining the JDBC URL at runtime ugly? Because you have to code it ?! You cannot simply configure it which makes using a lot of frameworks/libraries that use the database unnecessarily difficult (think: Spring, Hibernate, OJB, ...). Tom

Why are classpath databases always read-only ?

2005-12-08 Thread Thomas Dudziak
Hi, the manual says (http://db.apache.org/derby/docs/10.1/devguide/rdevdvlp38881.html): classpath Databases are treated as read-only databases, and all databaseNames must begin with at least a slash, because you specify them relative to the classpath directory. Now I wonder why that is so ?

Re: Why are classpath databases always read-only ?

2005-12-08 Thread Thomas Dudziak
On 12/8/05, Daniel John Debrunner [EMAIL PROTECTED] wrote: Would you consider adding it ? I think that is would be really useful because it would decouple the app from where it runs (without having to run Derby in server mode). If the 'you' means me, then I don't have the time or the itch

Re: Derby with beans and null primitives

2005-11-30 Thread Thomas Dudziak
On 11/30/05, Bryan Pendleton [EMAIL PROTECTED] wrote: 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

Re: Derby with beans and null primitives

2005-11-30 Thread Thomas Dudziak
On 11/30/05, Michael McCutcheon [EMAIL PROTECTED] wrote: Yes, I have heard of these, but there is a HUGE learning curve to these. What I need to do is fairly simple and does not require a complete 'persistence solution'. I just need to populate beans from resultsets and need to know how to

Re: MySQL to Derby export

2005-11-17 Thread Thomas Dudziak
On 11/17/05, Andre Bickford [EMAIL PROTECTED] wrote: Can anyone give me some advice on the best way to export a MySQL database to Derby? I've tried lots of different options with mysqldump but I can't seem to get a format that I can run through Derby. You could try DdlUtils

Re: conglomerate does not exist error

2005-11-13 Thread Thomas Dudziak
On 11/11/05, Susan Cline [EMAIL PROTECTED] wrote: I got this to work using the following configuration: Tomcat 5.5.9 with these edits to the server.xml file: Host Context path=/DerbyClasspathTest docBase=DerbyClasspathTest debug=5 reloadable=true crossContext=true !--

Re: conglomerate does not exist error

2005-11-10 Thread Thomas Dudziak
On 11/10/05, Knut Anders Hatlen [EMAIL PROTECTED] wrote: Just a wild guess: Starting ij in Eclipse sets derby.system.home to the directory where the database is located, hence the database is found. In the other cases derby.system.home is set to its default value (current working directory),

conglomerate does not exist error

2005-11-09 Thread Thomas Dudziak
Hi folks, I get the The conglomerate (1.056) requested does not exist. error with Derby 10.1.1.0 and I don't understand why. Here's the setup: * I've created a database (using embedded driver) via DdlUtils into my webapp-to-be-deployed in directory WEB-INF/classes/derbydb. The database correctly

Re: conglomerate does not exist error

2005-11-09 Thread Thomas Dudziak
On 11/9/05, Mike Matrigali [EMAIL PROTECTED] wrote: That stack does not include the derby internal stack, perhaps you still have it in derby.log? I'm not entirely sure what you mean by the derby internal stack and derby.log ? I run derby in embedded mode, how can I direct it to generate such a

Re: conglomerate does not exist error

2005-11-09 Thread Thomas Dudziak
Even more interesting, I simply stopped the web server and restarted it without any other changes, and now access to Derby works without problems, even after additional restarts. So this has to with first-time access to the database ? Tom