deploying derby db via tomcat

2006-12-27 Thread Amir Michail
Hi, I'm building a gwt app using derby db under eclipse. I'm looking for simple step-by-step instructions for deploying this app via tomcat. So far, I have managed to deploy the gwt app via tomcat excluding derby db. Amir

Re: deploying derby db via tomcat

2006-12-27 Thread Amir Michail
Shared libs or in your application's web-inf/lib. For my dev and prod servers, I have the db living in a similar place. The location string (the path) is stored as a variable that is substituted at runtime. Dan Jue On 12/27/06, Amir Michail [EMAIL PROTECTED] wrote: Hi, I'm building a gwt app

Re: deploying derby db via tomcat

2006-12-27 Thread Amir Michail
On 12/27/06, Amir Michail [EMAIL PROTECTED] wrote: Hi, I can't start the derby server outside of Eclipse properly. Using the startNetworkServer command, I get this error: ij select * from links; ERROR 42Y07: Schema 'AMICHAIL' does not exist This turned out to be a db path problem. The path

Re: deploying derby db via tomcat

2006-12-27 Thread Amir Michail
On 12/27/06, Amir Michail [EMAIL PROTECTED] wrote: ... I also had a security problem with the connect that I solved like this: http://forum.java.sun.com/thread.jspa?threadID=653424messageID=3840697 And yet another security problem (this one unrelated to derby db) fixed like this: http

Re: strange out of memory exception

2007-01-04 Thread Amir Michail
On 1/4/07, Amir Michail [EMAIL PROTECTED] wrote: Hi, I'm getting this exception: java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ040, SQLERRMC: Failed to start database 'myDB', see the next exception for details.::SQLSTATE: XJ001Java exception: 'Java heap space

Re: strange out of memory exception

2007-01-05 Thread Amir Michail
On 1/5/07, Per Newgro [EMAIL PROTECTED] wrote: Hey Amir, Context envCtx=(Context)initCtx.lookup(java:comp/env); DataSource ds = (DataSource)envCtx.lookup(jdbc/sampleDB); // fails Is initCtx.lookup(java:comp/env/jdbc/sampleDB) working? Thats the way

Re: strange out of memory exception

2007-01-05 Thread Amir Michail
Hi, I found this for tomcat 5.5; http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html However, I still don't know what to do: * for derby db, do I need to put anything in server.xml and/or web.xml? * is there a howto like this specifically for derby db? * what is a

error recovery

2007-01-06 Thread Amir Michail
Hi, I was wondering how a servlet should handle derby server problems. For example, what should happen if the derby server goes down? How should the servlet handle this situation as to not confuse the derby server on startup and cause severe errors (e.g., that might result in an immediate

handling race conditions

2007-01-09 Thread Amir Michail
Hi, I was wondering how one should handle race conditions. My problem has to do with generating ids. I suppose that generating ids using derby's auto generation does not result in any problems with respect to race conditions. However, in my case, I use a pair of items (x, y) where y starts

indexes

2007-02-04 Thread Amir Michail
Hi, Is there a way to get derby db to give a warning whenever it processes a query that would benefit significantly from the creation of additional index(es)? 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

changing not null to null

2007-02-18 Thread Amir Michail
Hi, Is there an easy way to change a not null column to a null one? Amir

client/server vs embedded

2007-02-23 Thread Amir Michail
Hi, There are places in my app where I invoke an sql command many times. I've already gained a significant speedup by using prepared statements. Would it be worth moving from client/server to embedded as well? What sort of speedup should I expect? If I do make the move to embedded, is there

Re: client/server vs embedded

2007-02-23 Thread Amir Michail
On 2/23/07, Jean T. Anderson [EMAIL PROTECTED] wrote: ... If I do make the move to embedded, is there any way I could use ij while the app is running? Your app could use an embedded server, which means your app would load the embedded driver for its own use and start the Network Server to

Re: client/server vs embedded

2007-02-23 Thread Amir Michail
no idea what is wrong. Amir On 2/23/07, Andrew McIntyre [EMAIL PROTECTED] wrote: On 2/23/07, Amir Michail [EMAIL PROTECTED] wrote: On 2/23/07, Jean T. Anderson [EMAIL PROTECTED] wrote: ... If I do make the move to embedded, is there any way I could use ij while the app is running? Your app

Re: client/server vs embedded

2007-02-24 Thread Amir Michail
On 2/23/07, Amir Michail [EMAIL PROTECTED] wrote: Hi, I got embedded working on my laptop under eclipse w/ gwt's hosted mode, but when deploying to my remote server I get a NoClassDefFoundError exception on TableScanResultSet. My tomcat WEB-INF/lib directory in the remote server includes all

Re: client/server vs embedded

2007-02-24 Thread Amir Michail
On 2/24/07, Amir Michail [EMAIL PROTECTED] wrote: On 2/23/07, Amir Michail [EMAIL PROTECTED] wrote: Hi, I got embedded working on my laptop under eclipse w/ gwt's hosted mode, but when deploying to my remote server I get a NoClassDefFoundError exception on TableScanResultSet. Moving

prepared statements

2007-02-26 Thread Amir Michail
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

Re: prepared statements

2007-02-26 Thread Amir Michail
On 2/26/07, Dag H. Wanvik [EMAIL PROTECTED] wrote: Bernt M. Johnsen [EMAIL PROTECTED] writes: Hi, This behaviour is defined in the JDBC specification. But Derby's statement cache works across connections, which alleviates redundant statement compilation. I ran into a connection lost

changing the default value for a column

2007-06-16 Thread Amir Michail
Hi, The column in question has type timestamp yet this doesn't work: ij alter table tablename alter column columnname default current_timestamp; ERROR 22005: An attempt was made to get a data value of type 'long' from a data value of type 'TIMESTAMP'. The table does not have any rows. Amir

adding foreign key that refers to primary key of same table

2007-06-28 Thread Amir Michail
Hi, How do you add a foreign key to an existing table that refers to the primary key of that table? Amir

can't access or create a db

2007-07-21 Thread Amir Michail
Hi, Not sure what happened, but now I can't access or create a db on my server: ERROR XJ041: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ041, SQLERRMC: Failed to create database 'testDB', see the next exception for details.::SQLSTATE: XBM0HDirectory /home/.../testDB cannot be created. If I copy

Re: can't access or create a db

2007-07-21 Thread Amir Michail
On 7/21/07, Myrna van Lunteren [EMAIL PROTECTED] wrote: On 7/21/07, Amir Michail [EMAIL PROTECTED] wrote: Hi, Not sure what happened, but now I can't access or create a db on my server: ERROR XJ041: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ041, SQLERRMC: Failed to create database 'testDB

Re: can't access or create a db

2007-07-21 Thread Amir Michail
Hi, Problem solved. Please ignore. Amir On 7/21/07, Amir Michail [EMAIL PROTECTED] wrote: On 7/21/07, Myrna van Lunteren [EMAIL PROTECTED] wrote: On 7/21/07, Amir Michail [EMAIL PROTECTED] wrote: Hi, Not sure what happened, but now I can't access or create a db on my server: ERROR

read only connection problem

2007-09-12 Thread Amir Michail
Hi, I tried copying a db as a starting point for a new app, but any connections I open are read only. Any suggestions as to what might be wrong? Amir

Is select distinct slow?

2007-12-22 Thread Amir Michail
Hi, Is there a way to speed things up with select distinct? Amir

how to recover from read only connection error?

2008-01-08 Thread Amir Michail
Hi, How do I recover from this error? ERROR 25503: DDL is not permitted for a read-only connection, user or database. Amir

Re: how to recover from read only connection error?

2008-01-08 Thread Amir Michail
On Jan 8, 2008 7:22 PM, Amir Michail [EMAIL PROTECTED] wrote: Hi, How do I recover from this error? ERROR 25503: DDL is not permitted for a read-only connection, user or database. Amir It turns out that not only do permissions need to be good, but also ownership. Amir

Re: how to recover from read only connection error?

2008-01-09 Thread Amir Michail
On Jan 9, 2008 11:19 AM, Kristian Waagan [EMAIL PROTECTED] wrote: Amir Michail wrote: On Jan 9, 2008 3:02 AM, Kristian Waagan [EMAIL PROTECTED] wrote: Amir Michail wrote: On Jan 8, 2008 7:22 PM, Amir Michail [EMAIL PROTECTED] wrote: Hi, How do I recover from this error? ERROR

column number mismatch error

2008-02-13 Thread Amir Michail
Hi, What does this error mean? ERROR XSCH5: In a base table there was a mismatch between the requested column number 9 and the maximum number of columns 10. This happens when I tried to add a reference to a primary key. Amir

Re: column number mismatch error

2008-02-13 Thread Amir Michail
On Feb 13, 2008 3:51 PM, Amir Michail [EMAIL PROTECTED] wrote: Hi, What does this error mean? ERROR XSCH5: In a base table there was a mismatch between the requested column number 9 and the maximum number of columns 10. This happens when I tried to add a reference to a primary key. Do

Re: column number mismatch error

2008-02-13 Thread Amir Michail
On Feb 13, 2008 7:13 PM, Amir Michail [EMAIL PROTECTED] wrote: On Feb 13, 2008 3:51 PM, Amir Michail [EMAIL PROTECTED] wrote: Hi, What does this error mean? ERROR XSCH5: In a base table there was a mismatch between the requested column number 9 and the maximum number of columns 10

Re: column number mismatch error

2008-02-14 Thread Amir Michail
On Thu, Feb 14, 2008 at 4:30 AM, Knut Anders Hatlen [EMAIL PROTECTED] wrote: Amir Michail [EMAIL PROTECTED] writes: On Feb 13, 2008 7:13 PM, Amir Michail [EMAIL PROTECTED] wrote: On Feb 13, 2008 3:51 PM, Amir Michail [EMAIL PROTECTED] wrote: Hi, What does this error mean

Re: column number mismatch error

2008-02-14 Thread Amir Michail
On Thu, Feb 14, 2008 at 10:49 AM, Amir Michail [EMAIL PROTECTED] wrote: On Thu, Feb 14, 2008 at 4:30 AM, Knut Anders Hatlen [EMAIL PROTECTED] wrote: Amir Michail [EMAIL PROTECTED] writes: On Feb 13, 2008 7:13 PM, Amir Michail [EMAIL PROTECTED] wrote: On Feb 13, 2008 3:51 PM

Re: column number mismatch error

2008-02-14 Thread Amir Michail
On Thu, Feb 14, 2008 at 1:19 PM, Kathey Marsden [EMAIL PROTECTED] wrote: Amir Michail wrote: ij alter table levels add column shape_id int references shapes; ERROR XSCH5: In a base table there was a mismatch between the requested column number 9 and the maximum number of columns 10

moving columns between tables

2008-02-19 Thread Amir Michail
Hi, Is there a way to easily move a column from one table to another (as easy as a rename say)? If not, maybe such a command could be added? Amir

Re: moving columns between tables

2008-02-19 Thread Amir Michail
On Feb 19, 2008 1:25 PM, Bryan Pendleton [EMAIL PROTECTED] wrote: Is there a way to easily move a column from one table to another (as easy as a rename say)? alter table newtable add column newcolumn whatever-data-type; update newtable set newcolumn = (value that the newcolumn should have);

how to set character encoding in ij tool?

2008-03-15 Thread Amir Michail
Hi, I would like to enter utf-8 characters via the ij tool. How do I set the encoding to utf-8? Amir

Re: how to set character encoding in ij tool?

2008-03-15 Thread Amir Michail
On Sat, Mar 15, 2008 at 9:09 AM, Amir Michail [EMAIL PROTECTED] wrote: Hi, I would like to enter utf-8 characters via the ij tool. How do I set the encoding to utf-8? Amir This doesn't work: java -Dderby.ui.codeset=UTF8 org.apache.derby.tools.ij Amir

Re: how to set character encoding in ij tool?

2008-03-15 Thread Amir Michail
On Sat, Mar 15, 2008 at 9:36 AM, Amir Michail [EMAIL PROTECTED] wrote: On Sat, Mar 15, 2008 at 9:09 AM, Amir Michail [EMAIL PROTECTED] wrote: Hi, I would like to enter utf-8 characters via the ij tool. How do I set the encoding to utf-8? Amir Please ignore. This helped

how do you make a column a primary key later?

2008-03-20 Thread Amir Michail
Hi, I would like to reference a column in another table but that column is not designated as a primary key and unfortunately referring to it explicitly results in this error: ERROR XSCH5: In a base table there was a mismatch between the requested column number 6 and the maximum number of columns

is it easy to change int to double?

2008-03-31 Thread Amir Michail
Hi, Is there an easy way to change a column type from int to double while automatically converting the data? Amir

Safe backups

2008-07-17 Thread Amir Michail
Hi, Would it be sufficient to shut down tomcat (using /etc/init.d/tomcat5.5 stop) before copying derby databases? What would happen to open connections if I do this? Could the copy be corrupt? Amir -- http://chatbotgame.com http://numbrosia.com http://twitter.com/amichail

Re: Safe backups

2008-07-18 Thread Amir Michail
a corrupt database copy? I'm using transactions, so isn't there protection against this sort of problem anyway? How long does it take to commit a transaction? Amir On Thu, Jul 17, 2008 at 11:45 PM, Amir Michail [EMAIL PROTECTED] wrote: Hi, Would it be sufficient to shut down tomcat (using

how to avoid field truncation in ij output?

2008-08-22 Thread Amir Michail
Hi, Is there a way to show the entire field no matter how long in ij output? Amir -- http://chatbotgame.com http://numbrosia.com http://twitter.com/amichail

How to export data?

2008-10-04 Thread Amir Michail
Hi, Is there an easy way to export derby data to another database say in the form of a csv file? Amir -- http://chatbotgame.com http://numbrosia.com http://twitter.com/amichail

Relational database scalability

2008-10-12 Thread Amir Michail
Hi, I've been using Derby db but will very likely move my development to the Google app engine to save money and create scalable code. Unfortunately, the Google app engine does not support schemas because apparently they would slow things down too much. Is this a general problem with relational

Most efficient way to get max row id?

2008-10-19 Thread Amir Michail
Hi, I was wondering what is the most efficient way to get the max automatically generated row id. select max(...) is slow. Amir -- http://chatbotgame.com http://numbrosia.com http://twitter.com/amichail

Re: Most efficient way to get max row id?

2008-10-19 Thread Amir Michail
On Sun, Oct 19, 2008 at 5:00 PM, Peter Ondruška [EMAIL PROTECTED] wrote: You want to use identity: Defining an identity column Yes, but how do you get the max row id efficiently without adding another row? Amir On Sun, Oct 19, 2008 at 10:52 PM, Amir Michail [EMAIL PROTECTED] wrote: Hi, I

How to efficiently check for existence of a row?

2008-10-19 Thread Amir Michail
Hi, Given some condition, how do you efficiently check whether there is at least one row that satisfies that condition? count(*) is slow. Amir -- http://chatbotgame.com http://numbrosia.com http://twitter.com/amichail

Re: Most efficient way to get max row id?

2008-10-19 Thread Amir Michail
On Mon, Oct 20, 2008 at 12:15 AM, Amir Michail [EMAIL PROTECTED] wrote: On Sun, Oct 19, 2008 at 11:25 PM, Kai Ponte [EMAIL PROTECTED] wrote: On Sunday 19 October 2008 02:04:29 pm Amir Michail wrote: On Sun, Oct 19, 2008 at 5:00 PM, Peter Ondruška [EMAIL PROTECTED] wrote: You want to use

Re: Most efficient way to get max row id?

2008-10-21 Thread Amir Michail
On Tue, Oct 21, 2008 at 2:32 PM, Andrew McIntyre [EMAIL PROTECTED] wrote: On Sun, Oct 19, 2008 at 1:52 PM, Amir Michail [EMAIL PROTECTED] wrote: Hi, I was wondering what is the most efficient way to get the max automatically generated row id. select max(...) is slow

getting first k rows from a query that satisfy some additional condition

2008-10-27 Thread Amir Michail
Hi, What is a good way for efficiently getting the first k rows from a query that also satisfy some additional condition to be determined using Java code? Amir -- http://chatbotgame.com http://numbrosia.com http://twitter.com/amichail

Re: getting first k rows from a query that satisfy some additional condition

2008-10-27 Thread Amir Michail
On Mon, Oct 27, 2008 at 1:14 PM, Amir Michail [EMAIL PROTECTED] wrote: Hi, What is a good way for efficiently getting the first k rows from a query that also satisfy some additional condition to be determined using Java code? BTW, even without this condition, the following approach is slow

Re: getting first k rows from a query that satisfy some additional condition

2008-10-27 Thread Amir Michail
On Mon, Oct 27, 2008 at 5:45 PM, Daniel Noll [EMAIL PROTECTED] wrote: Amir Michail wrote: Hi, What is a good way for efficiently getting the first k rows from a query that also satisfy some additional condition to be determined using Java code? setMaxRows(int) is the standard way of doing

Re: getting first k rows from a query that satisfy some additional condition

2008-10-27 Thread Amir Michail
:51, Amir Michail [EMAIL PROTECTED] wrote: On Mon, Oct 27, 2008 at 5:45 PM, Daniel Noll [EMAIL PROTECTED] wrote: Amir Michail wrote: Hi, What is a good way for efficiently getting the first k rows from a query that also satisfy some additional condition to be determined using Java

Re: getting first k rows from a query that satisfy some additional condition

2008-10-27 Thread Amir Michail
, 2008 at 23:02, Amir Michail [EMAIL PROTECTED] wrote: On Mon, Oct 27, 2008 at 5:59 PM, Peter Ondruška [EMAIL PROTECTED] wrote: Please, post the query you are running. There are queries where setMaxRows will not be faster, for example if you do GROUP BY or ORDER BY. The order is important

hash vs table scan

2008-11-03 Thread Amir Michail
Hi, What is the difference between a hash and table scan? Amir -- http://chatbotgame.com http://numbrosia.com http://twitter.com/amichail

How to delete with circular foreign key constraints?

2008-11-08 Thread Amir Michail
Hi, Is there an easy way to delete data in the presence of circular foreign key constraints? That is, how do you delete items from two or more tables at once so that these constraints are not violated? Amir -- http://chatbotgame.com http://numbrosia.com http://twitter.com/amichail

Why close ResultSet PreparedStatement?

2008-11-28 Thread Amir Michail
Hi, Is there any point in calling the close method on ResultSet and the close method of PreparedStatement? Amir -- http://b4utweet.com http://chatbotgame.com http://numbrosia.com http://twitter.com/amichail

Re: Why close ResultSet PreparedStatement?

2008-11-28 Thread Amir Michail
On Fri, Nov 28, 2008 at 9:11 PM, Amir Michail [EMAIL PROTECTED] wrote: Hi, Is there any point in calling the close method on ResultSet and the close method of PreparedStatement? Amir BTW, I'm using embedded mode. Why won't the garbage collector take care of this? Amir -- http

out of memory even though process size is small

2008-11-28 Thread Amir Michail
Hi, jsvc virt size is only 339m even though I specified it to be 1800m: export CATALINA_OPTS=-Xms1800m -Xmx1800m Could this out of memory problem be related to derby somehow? java.sql.SQLException: The exception 'java.lang.OutOfMemoryError: Java heap space' was thrown while evaluating an

Re: out of memory even though process size is small

2008-11-29 Thread Amir Michail
On Sat, Nov 29, 2008 at 2:03 AM, Amir Michail [EMAIL PROTECTED] wrote: Hi, jsvc virt size is only 339m even though I specified it to be 1800m: export CATALINA_OPTS=-Xms1800m -Xmx1800m Please ignore. I fixed the memory problem by modifying the /etc/init.d/tomcat5.5 script. Amir Could