•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 426,173 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,889 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 1546 | Replies: 3
![]() |
hi all
i m making a project using jsp as my front end and mysql as my back end.
i had to change backend from oracle to mysql bcoz of clients request.
now there is 1 problem i m facing.
there a password change option.
person enters its old password and then new password twice n clicks on submit.
although the password gets changed but it shows the else part,that the password is not changed.
this was working fine with oracle but no with mysql.
what could b the problem
i m making a project using jsp as my front end and mysql as my back end.
i had to change backend from oracle to mysql bcoz of clients request.
now there is 1 problem i m facing.
there a password change option.
person enters its old password and then new password twice n clicks on submit.
although the password gets changed but it shows the else part,that the password is not changed.
this was working fine with oracle but no with mysql.
what could b the problem
Last edited by bhuvan83 : Mar 23rd, 2007 at 5:59 am.
Bhuvan Aggarwal
There is no word impossible.
its i m possible
There is no word impossible.
its i m possible
Oracle and mysql use two different password encryption algorithms.
Are you talking about the password to connect to the database, or a password for user authentication?
How did you store the password in the database? Plain text, MD5, homegrown hash?
Could you post the relevant code? not the whole file , just the call to teh databse (minus your user&oass for the DB)
Are you talking about the password to connect to the database, or a password for user authentication?
How did you store the password in the database? Plain text, MD5, homegrown hash?
Could you post the relevant code? not the whole file , just the call to teh databse (minus your user&oass for the DB)
hi bro.
thanks for ur reply.
i m asking for password for user authentication.
the code i m using is
thanks for ur reply.
i m asking for password for user authentication.
the code i m using is
<%@ page errorPage="changepassword_error.jsp" import="java.sql.*" %>
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>:: Intranet ::</title>
<link href="tools/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<%!
Connection con;
Statement st;
ResultSet rs;
%>
<%
if(session.getAttribute("theName")==null){
response.sendRedirect("index_session.html");
}
session.getAttribute("theName");
String s2=request.getParameter("T2");
String s3=request.getParameter("T3");
try{
//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//con=DriverManager.getConnection("jdbc:odbc:index","scott","tiger");
Class.forName("com.mysql.jdbc.Driver");
String url ="jdbc:mysql://localhost:3306/Timesheet";
con =DriverManager.getConnection(url,"root", "");
st=con.createStatement();
int p=st.executeUpdate("update userTab set password='"+s3+"' where uname='"+session.getAttribute("theName")+"' and password='"+s2+"'");
if(p==1)
{
// response.sendRedirect("index.html");
//out.println("Password saved successfully!!!!!!!!!!!!!!");
%>
<script type="text/javascript">
alert("You have changed your password successfully!")
//window.history.load("mainscreen.jsp")
window.location.assign("index.html")
</script>
<!--<table width="100%" border="0" cellpadding="0" cellspacing="0" class="base">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150">
<img src="images/logo.gif" alt="" /></td>
<td class="top-bg"> </td>
<td width="196">
<img src="images/top_right.gif" alt="" /></td>
</tr>
</table></td>
</tr>
<tr>
<td height="22" class="top-menu"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
<td></td>
</tr>
</table></td>
</tr>
<table align="center"><tr><td><img src="images/trans.gif" alt="" width="20" height="10" ></td><td valign="bottom" height="30" ><font color="red"><b>Your password has changed successfully!</td></tr>
<tr height="30" align="center">
<td></td><td><a href="mainscreen.jsp">OK</a>
</td>
</tr></table>-->
<%
}
else{
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="base">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150">
<img src="images/logo.gif" alt="" /></td>
<td class="top-bg"> </td>
<td width="196">
<img src="images/top_right.gif" alt="" /></td>
</tr>
</table></td>
</tr>
<tr>
<td height="22" class="top-menu"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><!--<span class="welcome">Welcome! Shalini</span> Today is 11th Jan--></td>
<td align="right"><font color="white"><a href="mainscreen.jsp">Main menu</a> | <a href="changepassword.html">Change password</a> | <a href="logout.jsp">Logout</a></td>
</tr>
</table></td>
</tr>
<table align="center"><tr><td><img src="images/trans.gif" alt="" width="20" height="10" ></td><td valign="bottom" height="30" ><font color="red"><b>Password mismatch! Please try again.</td></tr>
<tr height="30" align="center">
<td></td><td><a href="mainscreen.jsp">OK</a>
</td>
</tr></table>
<%
//out.println("Please try again.....................");
}
}catch(Exception ee){out.println(ee);}
%>
</body>
</html> Bhuvan Aggarwal
There is no word impossible.
its i m possible
There is no word impossible.
its i m possible
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,453
Reputation:
Rep Power: 11
Solved Threads: 296
It is bad idea to setup conection to DB in JSP. It is all fashioned and left only for back compability from dark age of Java Web Development. You better of using servlets to handle connection and changes to DB
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- How to Connect MySQL from JSP Page (JSP)
- Inserting uft8 strings into MySQL from jsp page (JSP)
- Cant get a free web host for JSP & MYSQL (JSP)
- Problem connecting my Tomcat Server and MySQL using JSP (JSP)
Other Threads in the MySQL Forum
- Previous Thread: MySQL Libraries?
- Next Thread: My Sql Reports



Linear Mode