Rose Reid

Greenhorn
+ Follow
since Aug 16, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rose Reid

Is there a way to export data from an Excel spreadsheet and dump the data in an Oracle database (table) in Java? How?
-sixpaws
I was hoping someone could explain how to read an HTML file which links to other HTML files into a java swing component. I am trying to add this HTML file that explains the help stuff for this program to the drop down menu, so the use can select Help->About, then he will get this HTML file that loads. Any suggestions?
22 years ago
Thank you. This looks like it will help.
22 years ago
I am working on this project (java application) that I need to add a menu that give the user a Windows feel. I added "Help" to a menu and am going to add a next layer called "About". How would I go about displaying a pop up with text explaining the program when the user clicks on the "About" (similar to what happens when a user clicks "Help-About" in a Microsoft product).
22 years ago
I am getting a Number Format Exception Error I was hoping someone could tell me why.
I am saving a string variable to an Access database, ExpirationDate and want to retrieve it so I can compare the current date with it to see if a user's password has expired.
Here is the code:
public boolean expirationDate(String userID, String password) throws Exception {
// the return value
boolean expiredDate = false;
// the statement and resultset object
Statement stmt = null;
ResultSet rs = null;
try {
// the sql statement string
String sql = "SELECT * FROM PasswordTable " +
"WHERE USERID='" + userID + "' " +
"AND USERPWD='" + password + "'";
// create the resultset
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);

while (rs.next())
{
String ed = rs.getString("ExpirationDate");

// get expiration date from the database
// String ed = rs.getString("ExpirationDate");
// create calendar object for current date
Calendar cal = Calendar.getInstance();
cal.setTime(new java.util.Date());
java.util.Date ts = cal.getTime();
// format current date
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
String time_stamp = formatter.format(ts);
if ((Integer.parseInt(time_stamp) == Integer.parseInt(ed)) || (Integer.parseInt(time_stamp) > Integer.parseInt(ed))) {
// set the valid flag
expiredDate = true;
} else {
expiredDate = false;
}
}
} catch (Exception ex) {
expiredDate = false;
ex.printStackTrace();
}
// close the statement and result
close(stmt, rs);
// return the valid value
return expiredDate;
}