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)
{
...........
}