Thursday, October 06, 2005

What a signature can say about the attitude of a person!

Single underline below the sign: These persons are very confident and are good personalities. They are a little bit selfish but believe in "Happiness of human life"

Two dots below the sign: These persons are considered to be Romantic, can easily change their fiancées as if they change their clothes. They prefer beauty in other persons and they themselves try to look beautiful. They easily attract others.

Single dot below the sign: These persons are more inclined towards classical arts, simple and are very cool. If you loose faith with them, then these persons will never look back at you. Hence its always better to be careful with these people.

No underlines or dots below the sign: These persons enjoy their life in their own way, never pay attention to others views. These are considered to be good natured but are selfish too.

Random sign, no similarity between name and sign: These persons try to be very smart, hide each and every matter, never say anything in straight forward manner, never pay attention to the other person of what he is talking of.

Random sign, similarity between name and sign: These persons are considered to be intelligent but never think. These people change their ideas and views as fast as the wind changes its direction of flow. They never think whether that particular thing is right or wrong. You can win them just by flattering them.

Sign in printed letters: These persons are very kind to us, have a good heart, selfless, are ready to sacrifice their life for the sake of their near and dear. But these seem to think a lot and may get angry very soon.

Writing complete name as their sign: These persons are very kind hearted, can adjust themselves to any environment and to the person they are talking, these persons are very firm on their views and posses a lot of will power.

Moving the Cursor in Scrollable Result Sets

One of the new features in the JDBC 2.0 API is the ability to move a result set's cursor backward as well as forward.

Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
ResultSet srs = stmt.executeQuery("SELECT COF_NAME, PRICE FROM COFFEES");

TYPE_FORWARD_ONLY , TYPE_SCROLL_INSENSITIVE , and TYPE_SCROLL_SENSITIVE

CONCUR_READ_ONLY and CONCUR_UPDATABLE

TYPE_SCROLL_INSENSITIVE does not reflect changes made while it is still open and one that is TYPE_SCROLL_SENSITIVE does

The methods first , last , beforeFirst , and afterLast move the cursor to the row indicated in their names

The method absolute will move the cursor to the row number indicated in the argument passed to it

srs.absolute(4);

Retrieving Warnings

SQLWarning objects are a subclass of SQLException that deal with database access warnings. Warnings do not stop the execution of an application, as exceptions do; they simply alert the user that something did not happen as planned. For example, a warning might let you know that a privilege you attempted to revoke was not revoked. Or a warning might tell you that an error occurred during a requested disconnection.

A warning can be reported on a Connection object, a Statement object (including PreparedStatement and CallableStatement objects), or a ResultSet object. Each of these classes has a getWarnings method, which you must invoke in order to see the first warning reported on the calling object. If getWarnings returns a warning, you can call the SQLWarning method getNextWarning on it to get any additional warnings. Executing a statement automatically clears the warnings from a previous statement, so they do not build up. This means, however, that if you want to retrieve warnings reported on a statement, you must do so before you execute another statement.

The following code fragment illustrates how to get complete information about any warnings reported on the Statement object stmt and also on the ResultSet object rs :

Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("select COF_NAME from COFFEES");
while (rs.next()) {
String coffeeName = rs.getString("COF_NAME");
System.out.println("Coffees available at the Coffee Break: ");
System.out.println(" " + coffeeName);
SQLWarning warning = stmt.getWarnings();
if (warning != null) {
System.out.println("\n---Warning---\n");
while (warning != null) {
System.out.println("Message: "
+ warning.getMessage());
System.out.println("SQLState: "
+ warning.getSQLState());
System.out.print("Vendor error code: ");
System.out.println(warning.getErrorCode());
System.out.println("");
warning = warning.getNextWarning();
}
}
SQLWarning warn = rs.getWarnings();
if (warn != null) {
System.out.println("\n---Warning---\n");
while (warn != null) {
System.out.println("Message: "
+ warn.getMessage());
System.out.println("SQLState: "
+ warn.getSQLState());
System.out.print("Vendor error code: ");
System.out.println(warn.getErrorCode());
System.out.println("");
warn = warn.getNextWarning();
}
}
}

Warnings are actually rather uncommon. Of those that are reported, by far the most common warning is a DataTruncation warning, a subclass of SQLWarning. All DataTruncation objects have an SQLState of 01004, indicating that there was a problem with reading or writing data. DataTruncation methods let you find out in which column or parameter data was truncated, whether the truncation was on a read or write operation, how many bytes should have been transferred, and how many bytes were actually transferred.

How can I get to print the stacktrace for an exception occuring within my JSP page

By printing out the exception’s stack trace, you can usually diagonse a problem better when debugging JSP pages. By looking at a stack trace, a programmer should be able to discern which method threw the exception and which method called that method. However, you cannot print the stacktrace using the JSP out implicit variable, which is of type JspWriter. You will have to use a PrintWriter object instead. The following snippet demonstrates how you can print a stacktrace from within a JSP error page
page isErrorPage="true"

out.println(" ");
PrintWriter pw = response.getWriter();
exception.printStackTrace(pw);
out.println(" ");

Wednesday, October 05, 2005

Prevent Null in JSP

You could make a simple wrapper function, like
String blanknull(String s) {
return (s == null) ? \"\" : s;
}

and use blanknull(lastName) function in your text box

Tuesday, October 04, 2005

You will find the real IT stuff from this blog

Hi!! Welcome to all in real it world. You will find more IT stuff like languages Java, VB, Oracle and other new IT related topics.