473,486 Members | 1,850 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

tomcat setting for context

rohitrohitrohit
18 New Member
hello,
i am rohit.i am a beginner.i installed tomcat 5.0.28 in my window xp sev-2.i also test some servlets and jsp and html page which executed well.

i installed my tomcat in- c:\tomcat 5.0
my problem is that i make a login servlet which check for valid user and if they are valid the servets process forward.

but i am getting this error-
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified .

i saw related topics in googel for setting my server.xml file.

but i did not understand.so plz. solve my problems.
Nov 5 '07 #1
5 2494
r035198x
13,262 MVP
hello,
i am rohit.i am a beginner.i installed tomcat 5.0.28 in my window xp sev-2.i also test some servlets and jsp and html page which executed well.

i installed my tomcat in- c:\tomcat 5.0
my problem is that i make a login servlet which check for valid user and if they are valid the servets process forward.

but i am getting this error-
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified .

i saw related topics in googel for setting my server.xml file.

but i did not understand.so plz. solve my problems.
You need the MySQL driver added and set in the classpath for your servlets. You also apparently did not specify the database to connect to!
Nov 5 '07 #2
rohitrohitrohit
18 New Member
You need the MySQL driver added and set in the classpath for your servlets. You also apparently did not specify the database to connect to!

sir, i have installed sql 2005 in my system. and i installed tomcat 5.0.28 in c:\tomcat 5.0
Nov 6 '07 #3
r035198x
13,262 MVP
sir, i have installed sql 2005 in my system. and i installed tomcat 5.0.28 in c:\tomcat 5.0
Where did you put the driver for accessing the sql server database?
Post also the code you used for the connection to the database.
Nov 6 '07 #4
rohitrohitrohit
18 New Member
Where did you put the driver for accessing the sql server database?
Post also the code you used for the connection to the database.


sir,i am using j2sdkee1.2.1 with jdk1.3 to deploy my servlets and jsp.
sir, this code i written below works well and no error come.
but it take's a long procedure to deploy servlet and jsp.

so,i decided to use tomcat 5.0.28 and i red it's Basic concept.i installed it in my window xp.i downloaded exe from internet.
i am using sql2005 as my database.i tried some simple servlets,jsp(which does not required database connection), it executed in my
system.

i also set my envirnment variable-i installed tomcat5.0.28 in (Drive) C:\tomcat5.0.28
CATALINA_HOME-C:\Tomcat 5.0
JAVA_HOME-C:\j2sdk1.4.0_04
CLASSPATH-C:\Tomcat 5.0\common\lib\ant.jar;C:\Tomcat 5.0\common\lib\servlet-api.jar;C:\Tomcat 5.0\common\lib\jsp-api.jar;C:\Tomcat 5.0\common\lib\tools.jar


but when i am executing same code written below with tomcat 5.0.28 it generating
error-
"java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified "

i created my Directory structure under webapp folder as-
1) MYSite
--WEB-INF
--web.xml
* --classes
--lib
2) META-INF



public void doPost(HttpServletRequest req,HttpServletResponse res)
throws ServletException,IOException
{
String Login=req.getParameter("txtname");
String Password=req.getParameter("txtpassword");


try
{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("Jdbc:Odbc:myregis tration","sa","administrator123");
PreparedStatement pstat=con.prepareStatement("select * from registration where firstname=? and password=?");
pstat.setString(1,Login);
pstat.setString(2,Password);
ResultSet rs=pstat.executeQuery();
if(rs.next())
{

ServletContext context=getServletContext();
context.setAttribute("LoginName",Login);

RequestDispatcher dispatcher=req.getRequestDispatcher("/UserPageServlet");
dispatcher.include(req,res);
}
else
{
........................
}
catch(Exceptin e)
{
...........
}
Nov 8 '07 #5
rohitrohitrohit
18 New Member
can some one help me in this topic?
Dec 20 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3643
by: Jagdeesh | last post by:
Hai Colleagues, I am using Tomcat 4.1.24 and JDK 1.4.0_03 in my winXP machine. I've transferred a set of folders(containing jsp files) into tomcat's webapps directory(to /webapps/bob ,...
3
7414
by: joes | last post by:
Hello I am using tomcat 3.3.1 for an intranet application with other third party software. Unfortunately I have to remove from the web.xml the web-app valiadtion, because of the old third party...
2
9492
by: kimbuba | last post by:
Hi all, i'm writing cause i'm not able to find any good resources about this topic. I'm programming on tomcat and i have my browser open to see changes i made. The problem is that i'd like to see...
2
5755
by: devu | last post by:
Hello, I'm getting the following error when trying to start Apache Tomcat.The version shows up in the snapshot. I can't figure out why this is happening. It is aparently the <context-param> tag....
5
6447
by: Tom Martin | last post by:
I'm a Java Web developer NEWBIE that has inherited a website that fails every 2 hours due to poor connection pooling between Tomcat 4.0.6 and mySQL. In efforts to resolve this problem, I've...
1
10264
by: SPG | last post by:
Hi, I am relatively new to TOMCAT, and am trying to deploy a web app using it. I have a domain name that I want to use to access my web app directly. By default, I deploy my WAR, and it deploys...
4
11065
by: jesper | last post by:
Hi there. I have migrated from tomcat 4.1.31 to tomcat 5.5.7 I have a setup with many virtual hosts. I ame using the option in 5.5 to put context information in...
0
3650
by: Monica Ferrero | last post by:
Hi! I'm not sure if this is the most adequate mySQL list for this post. If not, please indicat me which one I should use... I'm using Tomcat 4.1.24 with Apache 2 and MySQL 4.0.13. I have the...
0
4159
by: Arun21084 | last post by:
Hi, Recently I installed an application HP SIP(Service Information Portal) on a Windows 2000 server.The application comes along with an installation of Tomcat 5.0.19. Already there was an Apache...
0
7094
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
5427
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4863
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.