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

Re: [xmlblaster] MySql persistance.



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.

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
MySql.

Regards




Michele


Peter Bennett wrote:

Greetings

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;.

Thoughts??????

Regards