Search code examples
jndimahout

Apache Mahout with JNDI to coonect to MySQLJDBCDataModel


I'm trying to use MySQL database with Apache Mahout to get the Database-based data. From what I read so far, it seems like I have to use a webserver like tomcat to use JNDI for the database connection. I'm wondering if it is possible to use JDNI outside of a webserver.

In short, can I use JNDI and not use a webserver in Mahout?

I know it won't be worth creating a desktop based recommended system. But for the time being, I don't want to run my application inside a webserver.


Solution

  • JNDI is a technology that is not specific to Tomcat, no. It is a directory service, part of J2EE, and supported by most J2EE containers -- like Tomcat, but also JBoss, etc.

    I don't quite understand the question, since you would only use JNDI in the context of an app or web server like Tomcat. But you don't want to use Tomcat. So why do you want to use JNDI?

    Certainly you don't need JNDI to use Mahout. Just pass it a DataSource that you configured, rather than looked up.