You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-user@db.apache.org by Laurent Sacaut <ls...@8d.com> on 2006/01/11 23:13:09 UTC

NullPointerException when trying to use SqlBuilder.alterDatabase

Hello,

I am getting familiarized with DdlUtils using a MySQL 4.1x database. I
am trying to alter an existing database so that new tables are created
and new columns are added to existing tables.
I am using the changeDatabase(..) as shown in the API usage example. I
keep getting an error at some point.

I traced the code and found out that it happens when
SqlBuilder.alterDatabase(Database currentModel, Database desiredModel,
CreationParameters params, boolean doDrops, boolean modifyColumns) is
called, more specifically when params is null (which it is in my case).

I narrowed it down to the createTable(desiredModel, desiredTable,
params.getParametersFor(desiredTable)) call in that function. It does
not go in, I guess because of the null params but I could be wrong. It
jumps out with the following message: java.lang.NullPointerException.
there is no more details about the exception.

Is there a way around this or some settings I missed?
thx.
Laurent



Re: NullPointerException when trying to use SqlBuilder.alterDatabase

Posted by Thomas Dudziak <to...@gmail.com>.
On 1/11/06, Laurent Sacaut <ls...@8d.com> wrote:

> I am getting familiarized with DdlUtils using a MySQL 4.1x database. I
> am trying to alter an existing database so that new tables are created
> and new columns are added to existing tables.
> I am using the changeDatabase(..) as shown in the API usage example. I
> keep getting an error at some point.
>
> I traced the code and found out that it happens when
> SqlBuilder.alterDatabase(Database currentModel, Database desiredModel,
> CreationParameters params, boolean doDrops, boolean modifyColumns) is
> called, more specifically when params is null (which it is in my case).
>
> I narrowed it down to the createTable(desiredModel, desiredTable,
> params.getParametersFor(desiredTable)) call in that function. It does
> not go in, I guess because of the null params but I could be wrong. It
> jumps out with the following message: java.lang.NullPointerException.
> there is no more details about the exception.

I think you're right, this is a bug. I'll fix it ASAP.

Tom

Re: NullPointerException when trying to use SqlBuilder.alterDatabase

Posted by Laurent Sacaut <ls...@8d.com>.
Resolved
That worked well. Thank for the quick fix. You rock :)
Laurent

Thomas Dudziak wrote:

>Please try the SVN trunk again, I've committed a fix.
>
>Tom
>
>  
>

Re: NullPointerException when trying to use SqlBuilder.alterDatabase

Posted by Thomas Dudziak <to...@gmail.com>.
Please try the SVN trunk again, I've committed a fix.

Tom