Placing WEKA DatabaseUtils.prop using tomcat
I'm using WEKA in a java project and I'm trying to deploy it on a Tomcat server using Eclipse.
I configured the DatabaseUtils.prop config file with my settings, in this case the mysql driver (when I test the config as a local java project connection works). Then I added it to the classpath.
Problems ap开发者_运维百科pear when I go through the webpage, the tomcat console says:
"No suitable driver found for jdbc:idb=experiments.prp"
I guess it means WEKA is not using my custom database.props but the default one, thus I don't know where to place mine in the project.
Any idea? thanks!
Well, I still don't know where to place the DataUtils.props but I found a workaround.
Just change the databaseurl from the InstanceQuery, and at the same time import the proper driver for the database in the project. Weka is supposed to try to find the correct driver automatically. Example:
InstanceQuery query = new InstanceQuery(); query.setDatabaseURL("jdbc:mysql://localhost:3306/tests");
and then add mysql drivers from org.hsqldb (for instance) to the project. Weka always throws some warnings regarding db drivers but it's ok.
精彩评论