- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- java resultset
Operating System - HP-UX
1777350
Members
3018
Online
109069
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2009 07:13 PM
тАО06-05-2009 07:13 PM
java resultset
Hi there
I have a strange problem with my Java app.
I'm testing if username and password is correct and retrieve 1 or 0.
But when I test with if (a == "1") then I get negative response as if the value stored in 'a' doesn't match.
I debugged the application but debugger shows a = "1" so I'm completely stupefied by this.
Please help.
===============================================
Statement select = c.createStatement();
ResultSet result = select.executeQuery("select count(*) from system_user where nm = '"
+ username + "' and pwd = '" + password + "'");
if (result != null) {
System.out.println("result !null");
while (result.next()) {
a = result.getString(1);
System.out.println(a);
if (a == "1"){
System.out.println(result.getString(1) + "Access granted");
}
}
}
if (a == "1"){
System.out.println("Access granted !!!");
}else{
System.out.println("User " + username + " does not exists in the databse!!!");
}
result.close();
I have a strange problem with my Java app.
I'm testing if username and password is correct and retrieve 1 or 0.
But when I test with if (a == "1") then I get negative response as if the value stored in 'a' doesn't match.
I debugged the application but debugger shows a = "1" so I'm completely stupefied by this.
Please help.
===============================================
Statement select = c.createStatement();
ResultSet result = select.executeQuery("select count(*) from system_user where nm = '"
+ username + "' and pwd = '" + password + "'");
if (result != null) {
System.out.println("result !null");
while (result.next()) {
a = result.getString(1);
System.out.println(a);
if (a == "1"){
System.out.println(result.getString(1) + "Access granted");
}
}
}
if (a == "1"){
System.out.println("Access granted !!!");
}else{
System.out.println("User " + username + " does not exists in the databse!!!");
}
result.close();
Jesus is the King
- Tags:
- Java
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2009 01:05 AM
тАО06-06-2009 01:05 AM
Re: java resultset
Any embedded nulls? What is the length?
What version of Java?
What version of Java?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2009 10:19 AM
тАО06-06-2009 10:19 AM
Re: java resultset
Nothing that I know of.
java version "1.6.0_14"
java version "1.6.0_14"
Jesus is the King
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP