cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Joseph <pjoseph...@yahoo.com>
Subject how does one use JDO to run ALTER TABLE sql command?
Date Sun, 19 Sep 2004 02:30:42 GMT
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


Mime
View raw message