i have project named 'online recruitment system'. there problem in database connectivity.
first made table 'registration' , 'clogindetails' without using quotes in sqlplus. data used save properly, on login getting following error:
java.sql.sqlexception: ora-00904: password: invalid identifier
after read stackoverflow multiple examples. , added "double quotes" table items in database , kept them in lowercase.
now data not getting saved. tried in 'object browser' in 'data' tab , there following error:
failed parse sql query: ora-00904: "pass": invalid identifier
as far know project made right. there problem in making tables.
here code 1 of page use table 'clogindetails':
string usrname=getclogid(); string pass=getcpassword(); if(usrname!=null && pass!=null && usrname.length()>0 && pass.length()>0) { ps = con.preparestatement("select * clogindetails logid=? , password=?"); ps.setstring(1,usrname); ps.setstring(2,pass); rs=ps.executequery(); httpsession session=request.getsession(true); if(!rs.next()) { errors.add("invalid", new actionmessage("errors.invalidusername")); } } rs.close(); ps.close(); con.close(); } catch(exception e) { e.printstacktrace(); } if(getclogid()==null || getclogid().length()<1) { errors.add("logid", new actionmessage("errors.logid.required")); } if(getcpassword()==null || getcpassword().length()<1) { errors.add("password", new actionmessage("errors.password.required")); } return errors;
the schema of clogindetails is
create table "clogindetails"( "admitid" number(15,0), "name" varchar2(25), "logid" varchar2(10), "pass" varchar2(20) )
try one:
change query
from: select * clogindetails logid=? , password=?
to: select * clogindetails logid='?' , password='?'
point when make queries, should spot identifiers ' ', otherwise seems comparing unknown table column's data (variables) data existing columns.
ex: select e.full_name e.employees e.full_name '&medet&'
otherwise you'll error.
hope you!
Comments
Post a Comment