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

Re: [xmlblaster] MySql persistance.

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

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


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



Michele Laghi
mailto:laghi at swissinfo.org
tel. +46 8 7492952 / mob. +46 70 4103964