Re: Question about TableFunctions in Derby

2009-07-14 Thread Suavi Ali Demir
Try something like this: select house_number, street, city from table (legacy_realty_data('house_number, street, city where price < 50')) then parse the string passed to your table function and implement a way to push down those predicates to your backend to only retrieve what is needed.

Re: Good, thin, ORM layer

2009-04-29 Thread Suavi Ali Demir
pureQuery may help. --- On Wed, 4/29/09, Maggi Federico wrote: > From: Maggi Federico > Subject: Good, thin, ORM layer > To: derby-user@db.apache.org > Date: Wednesday, April 29, 2009, 2:58 PM > Hello List, > >     I love embedded stuff. I love SQLite and > I love Derby even more. However, I

Re: DatabaseMetaData.getTables() resultset empty?

2008-11-09 Thread Suavi Ali Demir
Plz leave catalog as null. Ali --- On Sun, 11/9/08, Ole Ersoy <[EMAIL PROTECTED]> wrote: > From: Ole Ersoy <[EMAIL PROTECTED]> > Subject: Re: DatabaseMetaData.getTables() resultset empty? > To: "Derby Discussion" > Date: Sunday, November 9, 2008, 8:29 PM > Ali, > > I had percentage for the tab

Re: DatabaseMetaData.getTables() resultset empty?

2008-11-09 Thread Suavi Ali Demir
Try % instead of null. Ali --- On Sun, 11/9/08, Ole Ersoy <[EMAIL PROTECTED]> wrote: > From: Ole Ersoy <[EMAIL PROTECTED]> > Subject: Re: DatabaseMetaData.getTables() resultset empty? > To: "Derby Discussion" > Date: Sunday, November 9, 2008, 8:12 PM > Emmanuel, > > I gave it a go. > > String

Re: chinese text

2008-11-02 Thread Suavi Ali Demir
Insert the string value into the table. Language does not matter. Regards, Ali --- On Sun, 11/2/08, Graeme Henderson <[EMAIL PROTECTED]> wrote: > From: Graeme Henderson <[EMAIL PROTECTED]> > Subject: chinese text > To: derby-user@db.apache.org > Date: Sunday, November 2, 2008, 2:57 PM > What is

Re: Most efficient way to get max row id?

2008-10-19 Thread Suavi Ali Demir
You should have an index. --- On Sun, 10/19/08, Amir Michail <[EMAIL PROTECTED]> wrote: > From: Amir Michail <[EMAIL PROTECTED]> > Subject: Re: Most efficient way to get max row id? > To: "Derby Discussion" > Date: Sunday, October 19, 2008, 9:18 PM > On Mon, Oct 20, 2008 at 12:15 AM, Amir Micha

Re: Relational database scalability

2008-10-12 Thread Suavi Ali Demir
Google App Engine does not seem to be using a relational database. It looks like a hashtable. Joins are not possible. In other words, yes some relational database functionality is not possible to be scalable at the prices Google offers. So Google does not provide a relational database. But this

Re: Derby problem: 13GB of space with 200000 records!

2008-09-11 Thread Suavi Ali Demir
Does the same happen if you use single thread? Does disk space use go down if you compress table? Should the word=word.trim().toLowerCase(); appear before setString? When you store the frequency of words, you would have records like: "home", 1217 Then the number of rows would not exceed cou

Re: any feedback on this?

2008-06-23 Thread Suavi Ali Demir
for case insensitive index, you can have another column that holds lower-case version of your original column. you can create an index on that lowercase column and use it in your sql. you can use triggers to maintain the lowercase column. ali --- On Mon, 6/23/08, Alan Burlison <[EMAIL PROTECTE

Re: top N reporting with derby

2008-05-13 Thread Suavi Ali Demir
If 100 is not absolute necessity, you can give datetime ranges. For example select 1 hour of logs at a time. Ali --- On Tue, 5/13/08, Matt Chambers <[EMAIL PROTECTED]> wrote: From: Matt Chambers <[EMAIL PROTECTED]>Subject: top N reporting with derbyTo: derby-user@db.apache.orgDate: Tuesday, May 13,

Re: Starting Derby Server

2008-02-17 Thread Suavi Ali Demir
in derby's bin directory there is a startNetworkServer.bat regards, ali wotcha <[EMAIL PROTECTED]> wrote: Sorry if this has already been posted, but I'm a new Derby user. i've created an application using Netbeans 6.0 and embedded Derby DB - using the tutorial supplied by Netbeans - very im

Re: java.lang.OutOfMemoryError

2008-02-13 Thread Suavi Ali Demir
How much memory do you give to your JVM? Ali John English <[EMAIL PROTECTED]> wrote: I have a table containing about 22000 records defined as follows: CREATE TABLE system_log ( id INTEGER GENERATED ALWAYS AS IDENTITY, time TIMESTAMP DEFAULT NULL, username VARCHAR(15), facility VARCHAR(15) NOT

Re: Using derby as a chat server

2008-02-13 Thread Suavi Ali Demir
Have a table where you have 1 row that marks the relationship between two clients. Like a cartesian product: A, B A, C A, D B, A B, C B, D ..and so on. Have all clients have their dedicated connection acquire locks on these rows. Each lock represents a client that may post

Re: Double.NaN in table?

2007-12-18 Thread Suavi Ali Demir
By the way, while deciding whether a value x== Double.Nan or not, you probably cannot use == operator (may never be true). But if you compare string versions, they should equal ("NaN"). Ali Suavi Ali Demir <[EMAIL PROTECTED]> wrote: Can you make your column nullable

Re: Double.NaN in table?

2007-12-18 Thread Suavi Ali Demir
Can you make your column nullable and insert null instead of Nan? Ali David <[EMAIL PROTECTED]> wrote: For an application I am writing I need to store doubles in a table. I thought I could use the DOUBLE type when creating the columns in my tables. Unfortunately the insert fails when the

Re: newbie question

2007-12-16 Thread Suavi Ali Demir
drop the table and ignore the does not exist error. regards, ali Brad Berens <[EMAIL PROTECTED]> wrote: I've googled for this but all I can find is create statements so I'm hoping someone can just give me a quick answer. I'm trying to write some db creation scripts. Normally in MSSQL I w

Re: Migrating a MySQL Database to Apache Derby

2007-08-13 Thread Suavi Ali Demir
export the mysql ddl and manually convert it to derby ddl. create the derby database schema from this ddl. export mysql tables into delimited text files. import data from text files. regards, ali Bryan Richardson <[EMAIL PROTECTED]> wrote: Hello all, Can anyone tell me how I can mi

Re: GROUP_BY with user functions

2006-09-15 Thread Suavi Ali Demir
It seems you want all the repeating values next to each other? Would a sort help? Does order by work? Regards, Ali Robert Enyedi <[EMAIL PROTECTED]> wrote: Does Derby support user functions in GROUP BY clauses?I'm thinking of the following scenario:SELECT USER_FUNCTION(t1.column1)FROM TABLE t1G

Re: XMLPARSE/XMLSERIALIZE question

2006-08-29 Thread Suavi Ali Demir
Is the output of XMLSERIALIZE varchar?   If you are getting back a java string (or varchar etc), there is no need for the xml header to mention encoding (already have characers). If you get back a byte[] (or binary data), it should put the xml header so that the client can parse the xml using cor

RE: How to emulate multiple DISTINCT aggregates?

2006-08-28 Thread Suavi Ali Demir
r for 3. Now I wonder what the optimizer thinks of this and how, if at all, does it parallelize the query?   I’ll try my sql method on a similar table to yours, but I do think the response you saw wasn’t correct.  From: Suavi Ali Demir [mailto:[EMAIL PROTECTED] Sent: Monday, Augu

RE: How to emulate multiple DISTINCT aggregates?

2006-08-28 Thread Suavi Ali Demir
That query needs to be modified little bit. It does not work when my table contains:   1  1  12  2  21  1  3   result is 3,3,3, where as it should have been 2,2,3.   This one works:   SELECT (SELECT COUNT(DISTINCT b.field1) FROM table_a b) as field1_count, (SELECT COU

Re: Query performance of joining table and a view

2006-07-31 Thread Suavi Ali Demir
What is OCCURRENCE_INT_ATTRS? View or a table?   You probably have a correlated sub query that executes per row in your where clause. How does the select * from VIEW_OCCURRENCE_PRIORITY perform? If it's slow, perhaps you can re-write the whole thing (the view's select) as a join? [investigate gr

Re: Apache Derby (in the guise of Java DB) now shipping in Sun Java SE SDK

2006-06-16 Thread Suavi Ali Demir
Add a new column to the table, copy the data into new column, change your view (drop-create) to start using the new column and ignore the old column in the table. Ali Edson Carlos Ericksson Richter <[EMAIL PROTECTED]> wrote: Just curious, how could a view change datatype of one column?AFAIK, I c

Re: Apache Derby (in the guise of Java DB) now shipping in Sun Java SE SDK

2006-06-16 Thread Suavi Ali Demir
Updateable views would make it easy. Regards, Ali   Edson Carlos Ericksson Richter <[EMAIL PROTECTED]> wrote: Unfortunately, for developers, TBDITW don't allow change column names, datatypes, nullability, etc...At least, no without large efforts (like creating a new table, migrating all data to

Re: Iterate over big table...

2006-06-12 Thread Suavi Ali Demir
if it is a forward only cursor, when you do a select * and loop through all rows and doSomething() with each row (and not hold a reference to the data yourself), there would be only 1 row's data in memory at a given time, no? (or few rows if Derby prefetches in chunks as you do rs.next()) [EMAIL P

Re: equal query for derby " select sysdate from dual in oracle"

2006-06-09 Thread Suavi Ali Demir
Instead of "dual", in IBM lingo, i believe that table is called SYSIBM.SYSDUMMY1.   For example to test a connection you can use: SELECT 1 FROM SYSIBM.SYSDUMMY1   or yours would be:   SELECT CURRENT_TIMESTAMP FROM SYSIBM.SYSDUMMY1   VALUES(1) would work in DB2/LUW but not work in OS/390 f

Re: Derby Protocols

2006-05-20 Thread Suavi Ali Demir
derby:net is to connect to the network server, which could be running on another machine. it has host:port to connect to. You start the derby network server and it runs as a database server to serve many clients.   jdbc:derby:dbname is used to connect to a local database in embedded mode (derby c

RE: embedded derby -- does it leak

2006-02-15 Thread Suavi Ali Demir
Hi Jim,   How much memory did your colleagues start the JVM with when they evaluated Derby?   Regards, AliJim Newsham <[EMAIL PROTECTED]> wrote:  Rajesh,   Thanks for the update on DERBY-756.  Regarding DERBY-912, I recognize that it¡¯s a subtask of 756, nevertheless 756

PreparedStatement.setBinaryStream(s,length)

2006-01-14 Thread Suavi Ali Demir
Hello,   Does anybody know why the JDBC method:   PreparedStatement.setBinaryStream(s,size)   requires the caller to pass in the length of the stream?   Regards, Ali

Re: Recursive Select for Discussion Forum

2005-11-29 Thread Suavi Ali Demir
You do not necessarily need recursion to do that. Check out Ceolko's book for more info: http://www.elsevier.com/wps/find/bookdescription.cws_home/702605/description#description   This small article has nice images to give you ideas: http://www.codeproject.com/database/nestedsets.asp?df=100&fo

Re: MySQL to Derby export

2005-11-28 Thread Suavi Ali Demir
If you can find a tool specifically written to use jdbc/odbc bridge with MS Access, then you can port the schema too. In many ODBC metadata calls MS Access reports "unimplemented function" error. So, if the tool is not written specifically for MS Access (to work around those "unimplemented function

Re: Trying to use UPDATE that needs more then one table for its WHERE clause

2005-11-01 Thread Suavi Ali Demir
e update you suggested works with a constant. All I neednow is to get the update to use the data from the temp table.Any idea what else I am missing?Thanks,Ian--- Suavi Ali Demir <[EMAIL PROTECTED]>wrote:> update card set anythingyourwant where card.name in (> > select c.name> fro

Re: Trying to use UPDATE that needs more then one table for its WHERE clause

2005-10-31 Thread Suavi Ali Demir
update card set anythingyourwant where card.name in (   select c.namefrom edition as e, card_version as cv, card as c, edition as e2,session.load_card as lcwhere e.edition_id = cv.edition_id and c.card_id = cv.card_id and c.name = lc.name and c.card_id is not null and e.release_date < e2.release_d

Re: Tests in SQL

2005-09-30 Thread Suavi Ali Demir
SELECT    CASE WHEN COL1 is NULL THEN 0 ELSE 1 END    FROM MYTABLE   Regards, AliNicolas Dufour <[EMAIL PROTECTED]> wrote: HelloI try to put tests in select clause.I mean I have a field which can be null and I want to create a select which return 0 when the field is null and 1 in the other case.Is

Re: text datatype

2005-09-25 Thread Suavi Ali Demir
You can use varchar types and inside your saveDoc() function you can save the document in smaller chunks in multiple rows with an ORDERING column. Or call it PAGE column. When you readDoc() you can assemble them back again. Table data will look like:   DOCID   TEXT  PAGE 1   "Hello

Re: derby performance and 'order by'

2005-09-21 Thread Suavi Ali Demir
of optimization may be available or feasible to use at prepare> time but not execute time. > Ali> > > */Øystein Grøvlen <[EMAIL PROTECTED]>/* wrote:> > >>>>> "SAD" == Suavi Ali Demir writes:> > SAD> Another little detail about optimization

Re: derby performance and 'order by'

2005-09-21 Thread Suavi Ali Demir
prepare time but not execute time.  Ali Øystein Grøvlen <[EMAIL PROTECTED]> wrote: >>>>> "SAD" == Suavi Ali Demir <[EMAIL PROTECTED]>writes:SAD> Another little detail about optimization is thatSAD> Statement.setMaxRows() kind of functions on the JDBC side m

Re: derby performance and 'order by'

2005-09-20 Thread Suavi Ali Demir
Another little detail about optimization is that Statement.setMaxRows() kind of functions on the JDBC side may not be sufficient since it is called after SQL statement is prepared and returned as an object (after query plan is built). Therefore, it may be necessary to have language syntax to indica

Re: derby performance and 'order by'

2005-09-19 Thread Suavi Ali Demir
same time and one thread cannot read the chunk structure while another is inserting a value into it... Come to think of it, it might run faster in single thread version when synchronization is not involved. Regards, Ali Daniel John Debrunner <[EMAIL PROTECTED]> wrote: Suavi Ali Demir wrote:>

Re: derby performance and 'order by'

2005-09-19 Thread Suavi Ali Demir
Actually, it sounds like the problem of finding top 1000 rows out of  166333 rows is different than sorting 166333 rows and maybe it could be optimized. There is no need to sort all 166333 but the information that we are only looking 1000 rows would have to be passed all the way down to the point w

DriverManager question

2005-09-14 Thread Suavi Ali Demir
<[EMAIL PROTECTED]> wrote: Suavi Ali Demir wrote:> After a shutdown=true, you should be able to connect to the same> database again after doing a DriverManager.registerDriver(> Class.forName(driverName).newInstance() )No, that's not the correct way to start Derby or any other JDBC

Re: Unit tests with Derby DB

2005-09-14 Thread Suavi Ali Demir
Thanks for the clarification. Some applications might be actually registering the driver themselves. What are the problems that this might cause (if the app calls DriverManager.registerDriver() explicitly)? Regards, Suavi Daniel John Debrunner <[EMAIL PROTECTED]> wrote: Suavi Ali Demir

Re: Unit tests with Derby DB

2005-09-14 Thread Suavi Ali Demir
After a shutdown=true, you should be able to connect to the same database again after doing a DriverManager.registerDriver( Class.forName(driverName).newInstance() )   Then, if the shutdown=true cleans up as you expect, that should work fine for you.   Regards, SuaviLars Clausen <[EMAIL PROTECTED]>

Re: Question about handling of string of length 0 in PreparedStatement.setString()

2005-08-23 Thread Suavi Ali Demir
Hi Bryan,   I think that other database description you mention fits mysql. It does not report errors on datatype mismatches. Instead it makes a closest guess conversion and sticks the value there. According to their docs, it does these data conversions to the closest valid value because it had no

Correction: RES: how to fetch specific number of rows?

2005-08-01 Thread Suavi Ali Demir
D]> wrote: > Thank you, Ali! I'll take a look... > > -----Mensagem original- > De: Suavi Ali Demir [mailto:[EMAIL PROTECTED] > Enviada em: sábado, 30 de julho de 2005 21:57 > Para: Derby Discussion > Assunto: Re: how to fetch specific number of rows? > >

Re: how to fetch specific number of rows?

2005-07-30 Thread Suavi Ali Demir
Hi Paulo, This asp page discusses different ways of doing what you want: http://www.aspfaq.com/show.asp?id=2120 One of the easy SQL ways discussed there is: To fetch 5 rows at a time and get the 3rd page you would use this sql: SELECT a.empno FROM employee a I

Re: Using triggers and procedures?

2005-05-31 Thread Suavi Ali Demir
You may need to use it in a values clause in the trigger body: VALUES(APPBUT_USER.TRIGGER_RESIZE(schema,table)) Regards, Ali --- Peter Nabbefeld <[EMAIL PROTECTED]> wrote: > Jean T. Anderson schrieb: > > A trigger can't call a procedure, but it can call > a user-defined sql > > function. > > >

RE: Shutdown and reconnection results in "No suitable Driver"

2005-02-25 Thread Suavi Ali Demir
Well, since it says no suitable driver, maybe it is sufficient to re-register the driver. Did you try a Class.forName("drivername").newInstance() and maybe take that instance and use DriverManager.registerDriver(driver) ? Regards, Ali --- Bernd Ruehlicke <[EMAIL PROTECTED]> wrote: > Maybe the qu

Re: identity column causes grief when populating table - suggestions?

2005-02-22 Thread Suavi Ali Demir
The next import may be a table with foreign keys to the first one. Sometimes (most of the time actually) it is desireable to keep the original values in an identity column. Having to use "generated always" blocks many solutions including import/export, replication/sync where key space could be pa

Re: identity column causes grief when populating table - suggestions?

2005-02-22 Thread Suavi Ali Demir
Will derby support "default" keyword as in: create table a( id int not null generated by DEFAULT as identity, ... or something like that? That would solve these problems as it would only generate values if we do not specify the value. Regards, Ali --- Trevor Squires <[EMAIL PROTECTED]> wrote:

Re: International collation orders

2005-02-21 Thread Suavi Ali Demir
Does Derby use database locale or JVM locale for this purpose? Regards, Ali --- [EMAIL PROTECTED] wrote: > Hi, > > As for current Derby state, is it possible to use > localized sorting in VARCHAR and CHAR fields? > It should be simple as Derby is pure java program. > It just need to use proper ja

Re: How to set value to Blob field of derby-made-table.

2005-02-15 Thread Suavi Ali Demir
How about you first serialize your object into a byte[] and then do a setBytes() ? And then to read it back you can do getBytes() and then deserialize from that byte[]. Would that work? Regards, Ali --- Mithun Ruikar <[EMAIL PROTECTED]> wrote: > Hello there , > > I have problem while setting

Re: Obtaining JDBC connection using Derby embedded driver takes a long time...

2005-02-09 Thread Suavi Ali Demir
Yes it is normal. Imagine you are starting a whole database engine with that first connection and on top of that you are creating a brand new database when it is the first time: System.out.println("creating database"); Connection conn = DriverManager.getConnection("jdbc:derby:c:/temp/Wombat2DB;cre

Re: Auto-reconnect, connection pool connection validation query question

2005-01-20 Thread Suavi Ali Demir
values(1) This is valid derby sql. Regards, Ali --- Jonathan Eric Miller <[EMAIL PROTECTED]> wrote: > I'm in the process of attempting to use Derby with > Tomcat and it's built-in > connection pool. I'm wondering if Derby's JDBC > driver as an "autoReconnect" > property like MySQL has which

Re: JDBC driver question

2005-01-20 Thread Suavi Ali Demir
It may show error message if you call Exception.getMessage() or Exception.getLocalizedMessage() and also loop through nested exceptions using SQLException.getNextException() and get the nested exceptions' stack trace and getMessage(). I think Derby does not support RETURN_GENERATED_KEYS and neste

Re: Unable to create the second table in the SQL script

2004-12-28 Thread Suavi Ali Demir
Should the default value be a quoted string? 0 is probably not valid as a default value here. defaultpageid varchar(48) default 0 not null, Ali --- Nonick Me <[EMAIL PROTECTED]> wrote: > I'm trying to run the following SQL script. The > first table is created but not for the second table

Re: CREATE FUNCTION with SQL examples ?

2004-12-23 Thread Suavi Ali Demir
So, does this mean Derby always launches a separate thread to process a query? Regards, Ali --- Daniel John Debrunner <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Bernd Ruehlicke wrote: > > > Hmm - this "jdbc:default:connection" is a little > scary to me. S

Re: CREATE FUNCTION with SQL examples ?

2004-12-18 Thread Suavi Ali Demir
connection in such cases, no? Regards, Ali --- Daniel John Debrunner <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Suavi Ali Demir wrote: > > > To clarify: You shoul NOT close the connection > that > > you get from the UR

Re: CREATE FUNCTION with SQL examples ?

2004-12-18 Thread Suavi Ali Demir
; } > finally{ > conn.close(); //can add try and catch > here too, should you need > } > } > > Do let me know if it is otherwise > > -Rajesh > > > > Suavi Ali Demir wrote: > > >Rajesh, do you not need to close your statem

Re: CREATE FUNCTION with SQL examples ?

2004-12-18 Thread Suavi Ali Demir
s.close(); > s1.close(); > return l; > }catch(Exception e){ > conn.close(); > throw e; > } > finally{ > conn.close(); //can add try and catch > here too, should you need > } > } > > Do let me know if it is otherwise

Re: CREATE FUNCTION with SQL examples ?

2004-12-17 Thread Suavi Ali Demir
Rajesh, do you not need to close your statement and result set objects in a try-finally block? rs.close and s1.close() would be needed, no? But you should NOT close the connection, right? Regards, Ali public static long returnBigInt() throws Exception > { > Connection conn = > DriverManag

Re: CREATE FUNCTION with SQL examples ?

2004-12-17 Thread Suavi Ali Demir
Here is an example that behaves like the generate_unique() function of DB2: CREATE FUNCTION GENERATE_UNIQUE() RETURNS CHAR(13) FOR BIT DATA PARAMETER STYLE JAVA NO SQL LANGUAGE JAVA EXTERNAL NAME 'com.mycompany.MyClass.generate_unique'; Here is the corresponding java function in MyClass: sta

Re: Suggestions for improving performance?

2004-12-15 Thread Suavi Ali Demir
Is there a function that gives a list of available property names at system or database level? Or, if we know the name of a property, can we determine it's current value? Regards, Ali --- Daniel John Debrunner <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Barne