File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Decryption technique is not working in the JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Decryption technique is not working in the JSP page" Watch "Decryption technique is not working in the JSP page" New topic

Decryption technique is not working in the JSP page

rajkumar jayavel

Joined: Aug 09, 2011
Posts: 13
DataSource ds = null;
Connection con = null;
InitialContext ic;
PreparedStatement pr = null;
ResultSet rs = null;
String user = "";
String pass = "";
out.println("BFORE initiating the connection");
try {
ic = new InitialContext();
System.out.println("sql Query:"+sQuery);
out.println("sql Query:"+sQuery);
ds = (DataSource) ic.lookup("java:/daiichi_prd");
con = ds.getConnection();
pr = con.prepareStatement(sQuery);
rs = pr.executeQuery();
JTSSecurity objJTSSecurity = null;
while ( {
System.out.println("initiating the connection");
out.println("initiating the connection");
byte passwordbyte[] = rs.getBytes(1);
String passwordstr = new String(passwordbyte);
byte aabyte0[] = passwordstr.getBytes("ISO8859_1");
objJTSSecurity = new JTSSecurity();
byte value1[] = objJTSSecurity.decode(aabyte0);
pass = new String(value1);

user = rs.getString(2);

System.out.println("Test Print ln pwd:" + pass);
System.out.println("Test Print ln user" + user);
out.println("Test Print ln pwd:" + pass);
out.println("Test Print ln user" + user);
} catch (Exception e) {
out.println("Exception in connect cabinet..-->" + e.getMessage());

Following code could decrypt the password working fine in the stand alone java program,
whenver i added in the JSP tag its not working for me.

Not working and showing following values in the JSP Page:

its showing some junk characters while converted from the decode technique.
Junk output:s\wݪ�� ����
Expected output:original string value

Working fine in the java stand alone program:Expected output:sample123

Please help me
I agree. Here's the link:
subject: Decryption technique is not working in the JSP page
It's not a secret anymore!