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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to