Abgeschickt von Dennis am 14 Oktober, 2004 um 19:40:33:
Antwort auf: java.sql.SQLException: No suitable driver von Dennis am 13 Oktober, 2004 um 23:12:47:
Nevermind, I've found the problem. It turns out that I have an incorrect syntax to the db url field.
It should be jdbc:mysql://localhost:3306/test
I was missing a ":" after "mysql". I can't believe I missed that.
Sorry to be a bother.
D.
: Hi,
: I'm a newbie with using the JDBCAppender and I'm having a problem.
: After setting up my log4j.properties file to make use of the JDBCAppender as follows:
: # db: appender to log to database
: log4j.appender.db=org.apache.log4j.jdbcplus.JDBCAppender
: log4j.appender.db.url=jdbc:mysql//localhost:3306/test
: log4j.appender.db.dbclass=com.mysql.jdbc.Driver
: log4j.appender.db.username=test
: log4j.appender.db.password=test
: log4j.appender.db.sql=INSERT INTO log (date, level, location, message) VALUES ('Oct-10-2004','INFO','test.properties','it works!')
: log4j.appender.db.layout=org.apache.log4j.PatternLayout
: log4j.appender.db.layout.ConversionPattern=%m%n
:
: I get the following error message:
: log4j:ERROR JDBCAppender::flush_buffer(), :
: java.sql.SQLException: No suitable driver
: at java.sql.DriverManager.getConnection(Unknown Source)
: I double checked to make sure my driver (com.mysql.jdbc.Driver) exists in my build path, but still have no luck in getting an entry created in my data table and I have the above error message.
: I'm using Log4j v1.2.8
: My server is JBoss v3.2.4
: My database is MySql v4.0.2d
: My jdbc driver is connector-j v3.0.15
: Any insight on this matter would be appreicated.
: Thanks in advance.