1. For better performent in jsp use prepare statement when doing Oracle query.
e.g: PreparedStatement stmt = null;
stmt = conn.prepareStatement(myQuery);
2. StringTokenizer split the string by white spaces. Use "+" to get back the string.
e.g: str = new StringTokenizer(rs.getString("CPU")," ");
while (str.hasMoreTokens()) {
wdright = wdright + " " + str.nextToken();}
3. In window command line, if you have problem to run java in current directory load the CLASSPATH into it first.
e.g: C:\current_dir>set CLASSPATH=.;%CLASSPATH%
So, go any quick Java tips to share?
No comments:
Post a Comment