what is wrong in following code

<form name="log" method="post" action="login.htm">    
        
    <%
       try
        {
           
    	 //Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         //String url="jdbc:odbc:ODVS";
         Connection conn=null;//DriverManager.getConnection(url,"downtime","downtime");
         Class.forName("oracle.jdbc.driver.OracleDriver");
         conn=DriverManager.getConnection("jdbc:oracle:thin:@10.10.10.2:1521:PLMDM","vvv","vvv");
         String uid=request.getParameter("username");

         String pwd=request.getParameter("password");
 
         String sqlQry=("select * from USR_PASS_TB where username='"+uid+"' and password='"+pwd+"'"); 
         Statement stmt=conn.createStatement();
         ResultSet rs=stmt.executeQuery(sqlQry);
    
         if(rs.next()==true)
         {    
            //response.sendRedirect("../HTML/index_group.htm");  
       %>
          
             <jsp:forward page="login_cae.htm" />
         

       <%
       }
         else
         {
             //response.sendRedirect("..HTML/invalid_login.htm");
       %>
          <jsp:forward page="index_group.htm" />
              
       <%
         }
         rs.close();
         conn.close();
		            
         }
         catch(Exception e1)
       	 {
            System.out.println(e1);
	 }
    %>

Recommended Answers

All 3 Replies

Other than the fact that you shouldn't be doing this in a JSP, I don't know, since you haven't bothered to tell us what is going wrong with it, and I am not even going to attempt to guess.

What exceptions do you get?

store all jar file which is required for oracle in your web-inf folder. i think u miss it.

The more appropriate/correct way to do it is to put jar files required by project in PROJECT_DIRECTORY/WEB-INF/lib

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.