Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 62682 invoked from network); 19 Sep 2004 02:30:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 19 Sep 2004 02:30:56 -0000 Received: (qmail 17086 invoked by uid 500); 19 Sep 2004 02:30:47 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 17052 invoked by uid 500); 19 Sep 2004 02:30:46 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 17039 invoked by uid 99); 19 Sep 2004 02:30:46 -0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=DNS_FROM_RFC_ABUSE,FROM_ENDS_IN_NUMS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [206.190.39.232] (HELO web53303.mail.yahoo.com) (206.190.39.232) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 18 Sep 2004 19:30:45 -0700 Message-ID: <20040919023042.6213.qmail@web53303.mail.yahoo.com> Received: from [24.218.46.227] by web53303.mail.yahoo.com via HTTP; Sat, 18 Sep 2004 19:30:42 PDT Date: Sat, 18 Sep 2004 19:30:42 -0700 (PDT) From: Paul Joseph Subject: how does one use JDO to run ALTER TABLE sql command? To: Cocoon Users MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, My colleague and I are trying to use jdo to do an "alter table" command. There don't seem to be any examples showing how this is done and we are having a bit of a tough time. The logs show that the right statement is being executed. However, the following error is received: ========================== SQLQUERY: ALTER TABLE array_webtask_usr ADD COLUMN s_email varchar(100) [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: SQLException during the execution of the SQL query: No results were returned by the query. ========================== Question: how does one alter a table using jdo? A snippet of our code is as follows: try { String sqlQuery = "ALTER TABLE " + tableName + " ADD COLUMN " + columnName + " " + dataType + ";"; System.out.println("Query is" + sqlQuery); QueryBySQL querySql = new QueryBySQL(obj.getClass(), sqlQuery); broker = PersistenceBrokerFactory.defaultPersistenceBroker(); broker.beginTransaction(); broker.getObjectByQuery(querySql); broker.commitTransaction(); } catch (Exception e) { e.printStackTrace(); broker.abortTransaction(); return null; } --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org