Michael Waserman

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

Recent posts by Michael Waserman

And the first day of the month I can always get by adding 1 to the last day of the previous month.
Thanks. I did the search, found it.
19 years ago
How can I get the number of the month end day?

Thanks. Michael.
19 years ago
Upon finishing the session I would like to automatically close the browser for security purposes. How can I do it?

Thanks. Michael.
20 years ago
I am trying to compare first character in line to comma and getting "char cannot be dereferenced" error. Here is my code:

line.charAt(0).toString().equals(",");


What am i doing wrong?
Thanks. michael.
20 years ago
Anthony, thanks for your reply.

I have not dealt with the JSTL or Struts custom tags before and looking up info on them on the net I found that some web server setup would be nessesary to use them. Is that true? I am an application programmer and do not have direct access to Iplanet instance. Could you advise what to read to gain more understanding about the custom tags?

Also, if I go with your first example - could you please give me some more details (sorry for my luck of knowlege)
<a href="/myApp/myServlet?myParam1=value1&myParam2=value2">1</a>
What does the "?" mean? What's "value1&myParam2=value2"?
Can I write this href dynamicaly using "out.println" inside while loop?
Do you think I have to create as many forms as pages or one form is fine as I pass the page number as a parameter? How to pass the key(for database qyery) parameter from the other form of the same jsp along with the page parameter from this form?

Thank you.
20 years ago
JSP
Hello,
I am trying to create a jsp to be able to call page by page data from the database. Something similiar to what all the search engines have:

<< Previous 1 2 3 4 5 6 7 8 9 10 11 Next >>

Statically it looks and works good, but I need to be able to call a servlet by clicking on the page number and pass as a parameter the page number that I am quering as weel as some other key information. Code example or a link to some tutorial/book is greatly appreciated.

Thanks. Mike.
20 years ago
JSP
Gregg,
I think my problem has nothing to do with IPLANET. I might be wrong, but the application behaves differently depending on the connection technique that I am using.

Genereally my question is - is it absollutelly impossible to run concurently the same Java method in two different sessions if the method makes database calls?

Thanks. Michael.
20 years ago
How to make a Web(IPLANET)based application making calls to DB2 to run in the multi-user mode?

If I am using a single connection both sessions stop as soon as the second user started to execute the same method as the first one (it makes DB2 update calls).

If I am using a connection pool the first user is able to complete the session, but the second hungs untill his session goes down with StackOverflow error.

Thanks. Michael.
20 years ago
Calling the DB2-Cobol storprocedure from my Java program I had the table unavailability problems and decided to set COMMIT ON RETURN parameter to YES. Resource unavailability problem is gone, but also I've lost my result set:
"[NEON][SCODBCTS DLL]No result set available to fetch from"

Any help is greately appreciated.
Michael.
Here is the code example:
try {
pool = getPool ();
con = pool.getConnection ();
}
catch (Exception e) {
System.out.println (" Could not acquire a connection " + e.toString());
throw new ABCException(e.getMessage());
}
CallableStatement cs = null;
try {
while (iterator.hasNext()){
GetDataBean bean = (GetDataBean) iterator.next();
String result = "";
String functAdd = "C";
String batchNumber = bean.getBatchNum();
String tmStamp = "";
String message = bean.getMessage();
String rCode = "";

String sql = "call SYSPROC.ABCSP101(?,?,?,?,?,?)";

cs = con.prepareCall(sql);
cs.setString ( 1, functAdd);
cs.setString ( 2, batchNumber);
cs.setString ( 3, tmStamp);
cs.registerOutParameter(4, Types.CHAR);
cs.registerOutParameter(5, Types.CHAR);
cs.registerOutParameter(6, Types.CHAR);

cs.execute();

String curmessage = cs.getString(6);
rCode = cs.getString(5).trim();
GetDataBean beanOut = new GetDataBean();

if (rCode.equals("0000")) {
beanOut.setBatchNum(cs.getString(4);

beanOut.setMessage(message);
invalidEntries.add(beanOut);
}
}
cs.close();
pool.releaseConnection (con);
}
I am using the cobol stored procedure to execute the transaction/s. Tried it both ways, having the explicit commit in the storproc and without it. Does not make a lot of a difference. Also tried select statement "with UR".

The most annoying thing is when one user is upploading the data (it takes 40 - 60 sec) and the other is trying to display some records both would lose the sessions.

Thanks. Michael.
Thanks. Second set worked.
The first one does not return 26 characters, dropping the last 3 by some reason.


Thanks. Michael.
20 years ago
When I receive data from the database the timestamp is formatted as:
2004-09-27 21:32:28.844344 , but I need to have it in DB2 format as:
2004-09-27-21.32.28.844344

To reformat the timestamp I am using the following nethod:
String auxTimestmp = rs.getString(2);
StringBuffer buff = new StringBuffer();
buff.append(auxTimestmp.substring(0, 10));
buff.append("-");
buff.append(auxTimestmp.substring(11, 13));
buff.append(".");
buff.append(auxTimestmp.substring(14, 16));
buff.append(".");
buff.append(auxTimestmp.substring(17, 19));
buff.append(".");
buff.append(auxTimestmp.substring(20, 26));
String timestampString = buff.toString();

Is there more efficient way to do it?

Thanks. Michael.
20 years ago
I have a relatively large number of records to insert into DB2 database (we are using Neon Shadow Direct) in one shot.
To save the resources and lower the responce time I open the connection, itterate through my input and close when done with DB2 calls.

The problem is DB2 table gets locked.

If I open and close connection as many times as the records I have in my input the table is fine.

Could you please help?

Thank you. Michael.
What is the difference between these two objects in plain English?

Thanks. Michael.
20 years ago