Patch for ContentFilter plugin for all messages write to mysql DB

Hello

I patch ContentFilter plugin for all messages write to mysql DB from bandersnatch

I know what my patch is not very good, but I will need in integration bandersnatch

DB for this patch may be created by bandersnatch, but DB may be anything (rewrite SQL syntax)

else

DB not from bandersnatch.

BanderSnatch Web Front End does not WORK!!!

Sorry, my english. I am Russian.

I write patch in this message

34a35,36

import java.sql.*;

515d516

<

517a519,546

//*************

// Log.error("\n********************\ntest by Kirill\n");

try {

Connection conn=null;

conn = DriverManager.getConnection (“jdbc:mysql://127.0.0.1:3306/bandersnatch”, “bandersnatch”, “bandersnatch”);

Statement s = conn.createStatement ();

Message originalMsg = (Message) original;

s.executeUpdate (

"INSERT INTO message SET "+

"message_to=’’“originalMsg.getTo()”’’ "+

",message_from=’’“originalMsg.getFrom()”’’ "+

",message_body=’’“originalMsg.getBody()”’’ "

);

s.close();

}

catch(SQLException expt)

{

Log.error("\n****************\nKirill: Error connect mysql\n");

}

647c676

< }

\ ? ??? ??? ??? ??? ???


}

Hi,

So long as your drivers are available, I don’'t see a problem in terms of SQL statement.

However depending on your filter you may get a lot of messages needing to be stored. It may be better to store them up and periodically do a batch insert. Have a look at the iBall auditor for an idea of how to do this.

Cheers,

Conor