Java Servlets: Why hast though forsaken me? Part II

Sunday, April 8, 2007

Integrating mySQL with Java Servlets is tedious, but at least the GUI is easier to derive. Looks like it works OK, but there are still some java stuff I keep forgetting:

  1. Converting String to an Int -> Integer.parseInt(str); OR new Integer(str).intValue(); OR Integer.valueOf(str).intValue();
  2. String to byte[] -> str.getBytes();
  3. byte[] to String -> str.getBytes();
  4. int to String -> Integer.toStrin(n); OR “” + n;
  5. Integer to int -> num.intValue();
  6. String to char[] -> str.toCharArray();
  7. char[] to String -> new String(ca,0,ca.length);

Ugh. Now, I’m calling it a day.

Leave a Reply

You must be logged in to post a comment.