log4jdbc icon indicating copy to clipboard operation
log4jdbc copied to clipboard

please support mariadb

Open dylan-tao opened this issue 8 years ago • 1 comments

mariadb is very good product , Please attention to it and support on log4jdbc, thanks!

dylan-tao avatar Sep 15 '16 18:09 dylan-tao

@dylan-tao - Just fyi, if you're referring to the formatted SQL output, you may be able to get by with a little hack:

package some.util.pkg;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.util.Map;

public class DriverSpy extends net.sf.log4jdbc.DriverSpy {

	static {
		try {
			Field rdbmsSpecificsField = net.sf.log4jdbc.DriverSpy.class.getDeclaredField("rdbmsSpecifics");
			rdbmsSpecificsField.setAccessible(true);

			Class<?> clazz = Class.forName("net.sf.log4jdbc.MySqlRdbmsSpecifics");
			Constructor<?> constructor = clazz.getDeclaredConstructor();
			constructor.setAccessible(true);

			Map rdbmsSpecifics = (Map) rdbmsSpecificsField.get(null);
			rdbmsSpecifics.put(org.mariadb.jdbc.Driver.class.getName(), constructor.newInstance());
		} catch (Exception e) {
			throw new ExceptionInInitializerError(e);
		}
	}
}

Mike-Reid avatar Feb 12 '17 10:02 Mike-Reid

Done. Sorry for LOOONG delay :)

arthurblake avatar Apr 05 '23 21:04 arthurblake