Obtaining Wireless News with J2ME and PHP

J2ME and PHP are both powerful technologies used to develop applications for mobile devices and Web applications, respectively. In this article, you’ll see how to make them work together by developing a simple and useful application that retrieves the latest news from the Web and displays that on a mobile device. The Java 2 Platform,…

OutOfMemoryError in Eclipse | Java Virtual Machine (JVM)

OutOfMemoryError in Eclipse | Java Virtual Machine (JVM) It might happen that while running a Java application within the Eclipse environment you get an OutOfMemoryError due to the maximum amount of memory dedicated to the heap. You can fix it by increasing the minimum (-Xms parameter) and maximum (-Xmx parameter) heap size. You can do…

Mapping between charset name and Java name

The following table shows a mapping between XML names and Java names for encoding. An example of class where you can use these Java names for encoding is the OutputStreamWriter class Table 1. Standard Character Sets and Encodings XML Name Java Name First supported in Java Scripts and Languages ISO-8859-1 8859_1 1.1 Latin-1: ASCII plus…

How to get the number of columns in a ResultSet in Java

In Java it is possible to retrieve the number of columns of a ResultSet dinamically, thanks to the ResultSetMetaData class. Here’s an example:

The previous code retrieves and displays the number of columns of your_table.

Very Useful Shortcuts for Eclipse

Who uses eclipse already knows how fantastic this great IDE is. Here I want to provide a table with the shortcuts I use almost ever when I develop in Java. Action Shortcut Toggle Comment Ctrl+7 Show Tooltip F2 Format Code Ctrl+Shift+F Indent Line Ctrl+I Duplicate Lines Down Ctrl+Alt+Down Arrow Duplicate Lines Up Ctrl+Alt+Up Arrow Delete…