tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Medha Parathasarathy" <medh...@fastmail.fm>
Subject RE: Assistance required
Date Thu, 16 Feb 2006 12:44:25 GMT
I have gone through the server.xml model given by the tomcat site.
However when i try to test the connectivity using a java program :

========================================================
import java.sql.*;

public class jdbc
{
	public static void main(String args[]) throws Exception
	{
		Class.forName("com.mysql.jdbc.Driver");
		Connection con = DriverManager.getConnection("jdbc:mysql://localhost/B2BData");
		Statement st = con.createStatement();
		ResultSet rs = st.executeQuery("select * from admuser");
		while(rs.next())
		{
			System.out.println(rs.getString(1));
		}
		con.close();	
	}
}

===============================================================================================
when i compile the program with javac jdbc.java no eror is given however
when i run the program i get the following errors :

java ./jdbc
Exception in thread "main" java.lang.NoClassDefFoundError: ./jdbc
   at gnu.java.lang.MainThread.run() (/usr/lib64/libgcj.so.6.0.0)
Caused by: java.lang.ClassNotFoundException: ./jdbc
   at java.lang.Class.forName(java.lang.String, boolean,
   java.lang.ClassLoader) (/usr/lib64/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/usr/lib64/libgcj.so.6.0.0)

Now i donot know what to do further.

Regards


Sarathy


On Thu, 16 Feb 2006 15:41:49 +0530, "Awaneesh Shatmanyu"
<a.shatmanyu@zensar.com> said:
> Hi,
> 
> You can visit the site www.coreservlets.com , it will help to configure
> the Tomcat.
> You would be able to get the examples of server.xml and web.xml too.
> 
> Regards,
> Awaneesh Shatmanyu
> 
> 
> 
> -----Original Message-----
> From: Medha Parathasarathy [mailto:medhaps@fastmail.fm] 
> Sent: Thursday, February 16, 2006 11:29 AM
> To: Tomcat Users List
> Subject: Assistance required
> 
> Hi,
> 
> I am new to tomcat. I am trying to configure tomcat, jdbc and mysql. I
> am facing problem in the configuration of jdbc. Can some body assist me
> with a prototype of server.xml and web.xml
> 
> environement fedore core4 
> 
> regards
> 
> 
> -- 
> http://www.fastmail.fm - A no graphics, no pop-ups email service
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 
> 
> This email may contain confidential or privileged information for the 
> intended recipient(s) and the views expressed in the same are not 
> necessarily the views of Zensar Technologies Ltd. If you are not the
> intended 
> recipient or have received this e-mail by error, its use is strictly 
> prohibited, please delete the e-mail and notify the sender. Zensar 
> Technologies Ltd. does not accept any liability for virus infected mails.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

-- 
http://www.fastmail.fm - Access your email from home and the web


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message