[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xmlblaster] MySql persistance.
Greetings
I need to work on a plugin that uses similar code and
methodology to commontable anyway...
I am developing an ACL plugin which is based around the htpassword
plugin... Still uses Htpassword but adds ACL feature using session
isAuthorized(). This feature needs tables etc....
It is aimed at something slightly different...
Client ---- http/s ---- PHP page --- xml-rpc --- xmlBlaster
Using the PHP to form a security bridge between clients and xmlBlaster.
The PHP logs in using htpasswd auth and then validates the clients
identity with the object acl in isAuthorised.
Finally I am not able to work full time on development so it will
be a while before I finish it all...
I would like to add the plugin to the base code of xmlBlaster
however I will need to run it past yourself and Marcel first.
And there is still a lot I need to learn... Test suite/docs etc...
Regards
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.
Cheers
Michele
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