Connetion between Tomcat & MySQL
Hi, I am using Tomcat 3.3.1 and MySQL 4.0 in Window XP. MySQL engine is running. When I run my jsp, it stated the error that "import com.mysql.Driver" not found. Anyone know how to install the driver properly? I read something about setting the class path. But where to set? I don't know much about the MSDOS command and specify the envirnomental variables in Window XP. I download both the J/Connector & OCBC driver from MySQL. Where should be the exact location to store? Thanks, Amy Cheung __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connetion between Tomcat & MySQL
Assuming that you aren't using JDBCRealm, then it should be enough to put the jar file in $TOMCAT_HOME/lib/apps. If you are using JDBCRealm, then place it in $TOMCAT_HOME/lib/common. Setting the CLASSPATH is evil ;-). "Amy Cheung" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I am using Tomcat 3.3.1 and MySQL 4.0 in Window XP. > MySQL engine is running. When I run my jsp, it stated > the error that "import com.mysql.Driver" not found. > Anyone know how to install the driver properly? I read > something about setting the class path. But where to > set? I don't know much about the MSDOS command and > specify the envirnomental variables in Window XP. I > download both the J/Connector & OCBC driver from > MySQL. Where should be the exact location to store? > > Thanks, > Amy Cheung > > __ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connetion between Tomcat & MySQL
so what kind of connection is best? using the J/Connector or the OCBC one? --- Bill Barker <[EMAIL PROTECTED]> wrote: > Assuming that you aren't using JDBCRealm, then it > should be enough to put > the jar file in $TOMCAT_HOME/lib/apps. If you are > using JDBCRealm, then > place it in $TOMCAT_HOME/lib/common. > > Setting the CLASSPATH is evil ;-). > > "Amy Cheung" <[EMAIL PROTECTED]> wrote in > message > news:[EMAIL PROTECTED] > > Hi, > > > > I am using Tomcat 3.3.1 and MySQL 4.0 in Window > XP. > > MySQL engine is running. When I run my jsp, it > stated > > the error that "import com.mysql.Driver" not > found. > > Anyone know how to install the driver properly? I > read > > something about setting the class path. But where > to > > set? I don't know much about the MSDOS command and > > specify the envirnomental variables in Window XP. > I > > download both the J/Connector & OCBC driver from > > MySQL. Where should be the exact location to > store? > > > > Thanks, > > Amy Cheung > > > > __ > > Do you Yahoo!? > > Yahoo! SiteBuilder - Free, easy-to-use web site > design software > > http://sitebuilder.yahoo.com > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connetion between Tomcat & MySQL
--- Bill Barker <[EMAIL PROTECTED]> wrote: > Assuming that you aren't using JDBCRealm, then it > should be enough to put > the jar file in $TOMCAT_HOME/lib/apps. If you are > using JDBCRealm, then > place it in $TOMCAT_HOME/lib/common. > > Setting the CLASSPATH is evil ;-). > > "Amy Cheung" <[EMAIL PROTECTED]> wrote in > message > news:[EMAIL PROTECTED] > > Hi, > > > > I am using Tomcat 3.3.1 and MySQL 4.0 in Window > XP. > > MySQL engine is running. When I run my jsp, it > stated > > the error that "import com.mysql.Driver" not > found. > > Anyone know how to install the driver properly? I > read > > something about setting the class path. But where > to > > set? I don't know much about the MSDOS command and > > specify the envirnomental variables in Window XP. > I > > download both the J/Connector & OCBC driver from > > MySQL. Where should be the exact location to > store? > > > > Thanks, > > Amy Cheung > > > > __ > > Do you Yahoo!? > > Yahoo! SiteBuilder - Free, easy-to-use web site > design software > > http://sitebuilder.yahoo.com > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connetion between Tomcat & MySQL
I'll assume that you're using Connector /J. Stick the file mysql-connector-java-x.y.zz-bin.jar (where "x.y.zz" is the version number) in Tomcat's common/lib directory. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connetion between Tomcat & MySQL
My apologies (and my tping error), the directory should be "common/lib", not "lib/common". - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connetion between Tomcat & MySQL
Any JDBC driver for mysql (that works for you) will do. Amy Cheung wrote: so what kind of connection is best? using the J/Connector or the OCBC one? --- Bill Barker <[EMAIL PROTECTED]> wrote: Assuming that you aren't using JDBCRealm, then it should be enough to put the jar file in $TOMCAT_HOME/lib/apps. If you are using JDBCRealm, then place it in $TOMCAT_HOME/lib/common. Setting the CLASSPATH is evil ;-). "Amy Cheung" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, I am using Tomcat 3.3.1 and MySQL 4.0 in Window XP. MySQL engine is running. When I run my jsp, it stated the error that "import com.mysql.Driver" not found. Anyone know how to install the driver properly? I read something about setting the class path. But where to set? I don't know much about the MSDOS command and specify the envirnomental variables in Window XP. I download both the J/Connector & OCBC driver from MySQL. Where should be the exact location to store? Thanks, Amy Cheung __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connetion between Tomcat & MySQL
There is two things you can do. Set your CLASSPATH to include mm.mysql.driver and include the jar in your webapps lib folder. HTH Kind Regards Schalk Volume4
Re: Connetion between Tomcat & MySQL
OK. Thanks. It can connects to the database now. Here is a minor problem. The results I obtained from the query is a ResultSet, rs. I keyed in this code: while (rs.next()) { System.out.print(rs.getString("RoomID"); } In the Tomcat server, it printed the results that I wanted. How to incorporate that results into the html code to show on the web page? I tried but it's give me error that cannot convert ResultSet into String. Thanks, Amy Cheung --- Kwok Peng Tuck <[EMAIL PROTECTED]> wrote: > Any JDBC driver for mysql (that works for you) will > do. > > Amy Cheung wrote: > > >so what kind of connection is best? using the > >J/Connector or the OCBC one? > > > >--- Bill Barker <[EMAIL PROTECTED]> wrote: > > > > > >>Assuming that you aren't using JDBCRealm, then it > >>should be enough to put > >>the jar file in $TOMCAT_HOME/lib/apps. If you are > >>using JDBCRealm, then > >>place it in $TOMCAT_HOME/lib/common. > >> > >>Setting the CLASSPATH is evil ;-). __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Connetion between Tomcat & MySQL
That's just not good advice at all. I don't know where people get the idea of touching CLASSPATH when they're talking about Tomcat and web-apps in general. Drivers should be placed in common/lib or WEB-INF/lib. That's IT. And mm.mysql.driver? You mean: com.mysql.jdbc.Driver And one last rant, as Chris Williams started to point out... ODBC is a Microsoft data access abstraction layer. ODBC = Microsoft Way of doing it JDBC = Java way of doing it So you'd only download or use the ODBC driver if you were accessing MySql from a VB or C# program. > -Original Message- > From: Schalk [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 09, 2003 6:20 AM > To: Tomcat Users List > Subject: Re: Connetion between Tomcat & MySQL > > > There is two things you can do. Set your CLASSPATH to include > mm.mysql.driver and include the jar in your webapps lib folder. > > HTH > > Kind Regards > Schalk > Volume4 > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connetion between Tomcat & MySQL
You may want to put the JDBC driver jar file under %TOMCAT_HOME%/common/lib and try again. This is the location where the classloader loads the classes which makes available to all Tomcat applications. Marco - Original Message - From: "Amy Cheung" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Tuesday, September 09, 2003 4:40 AM Subject: Connetion between Tomcat & MySQL > Hi, > > I am using Tomcat 3.3.1 and MySQL 4.0 in Window XP. > MySQL engine is running. When I run my jsp, it stated > the error that "import com.mysql.Driver" not found. > Anyone know how to install the driver properly? I read > something about setting the class path. But where to > set? I don't know much about the MSDOS command and > specify the envirnomental variables in Window XP. I > download both the J/Connector & OCBC driver from > MySQL. Where should be the exact location to store? > > Thanks, > Amy Cheung > > __ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software > http://sitebuilder.yahoo.com > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]