[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster] MySql persistance.

Greetings Marcel


Development comes second after making a living for me
so it is hard for me to make any commitments...

One week I could be free next as busy as anything.


Marcel Ruff wrote:
Michele Laghi wrote:

Hi Peter,

Peter Bennett wrote:

Michele Laghi wrote:

Hi Peter,
one quick solution would be to manually create such a table (I think that's the way Zang solved it for the SQL Server).

Yep thought of that but thats not the point of looking at the code in
the first place... manual operation? I am a coder what does that mean :)

As a second step we could let JdbcManagerCommonTable make that work for you.

If you want to develop an own plugin its fine. Note however that the fix which lets JdbcManagerCommonTable handle MySQL would be only a few lines of code:

before making the check of line 377,7 you could just check if the table specified with tablesTxt exists. If not, then you could create one. When subsequently JdbcManagerCommonTable creates the needed tables it also adds them to this newly created table.

I think this fix is easier to implement than to write an entierly new plugin. Particularly I am thinking of TESTING (which normally always shows up to be more timecostly than the implementation). Also porting to Oracle would not be necessary.

If you are in a hurry you could do it yourself, otherwise I could it implement in the next couple of days (next week).

Please let me know.


i think what we need urgent as well is support for a native embedded DB
so we can finally make the stable release 0.85
Any volunteers ? :-)



I will work on that in the plugin I am developing then we can look at
reusing the code I write to deal with postgres and mysql in the
commontable class... I do have a copy of Oracle 8i but not running
on a machine so may have to leave that fine tuning/testing to someone else. I was looking at the code in JdbcManagerCommonTable.java with a view to code consistancy with the stuff I am writing but I do want to
support/use mysql as well.

By the way it makes no diff to me what the db is I just want to support the most common ones out of the box as much as I can.

I need to study and test for a few days... Some of the new stuff in
MySql is new to me (InnoDB). Its been a while since I last coded for



Peter Bennett wrote:


Has anyone actually tried to make the persistance layer
work with MySql db?

I do not think this code from JdbcManagerCommonTable.java
public final boolean tablesCheckAndSetup(boolean createTables)
Line 377,7 will work with MySql.

String req = "SELECT count(*) from " + tablesTxt + " where upper(" + tableNameTxt + ")='" + this.nodesTableName.toUpperCase() + "'";

I find no reference to a table that holds a list of tables (tableTxt)
like postgres (pg_tables) and Oracle (ALL_TABLES) obviously do....

Mysql uses an sql statement that only shows tables in the current db.
Show Tables;

If you want to list all tables you need to show databases, enumerate
through the databases with setCatalog and list tables with show tables;.