Category: Java

Query AS400/iSeries from JDBC

We are migrating an in house system from the AS400 to Oracle, and I needed to look at the data in its “raw” format to assist with a migration plan. I ended up using JDBC rather than the GUI provided…

OutOfMemory error in one classloader

I thought this was interesting. If an OutOfMemory error (not exception, there is a difference) is thrown in one classloader when multiple class loaders are in use, it won’t cause the entire JVM to abort as it will when it…

Example of creating an order in ATG

I spent a lot of time understanding the plumbing of the Pipeline, OrderManager, etc. As I have indicated in the past, simple startup examples of ATG development are hard to find. The out of the box form handlers work far…

Handling out of memory errors in Hotspot

The Hotspot compiler does not have an ExitOnOutOfMemoryError as the JRockit compiler does. You can simulate it on linux with something like what is below. We start with our test code that will ensure an out of memory condition… import…

Finding memory metrics in JBOSS

I can never remember how to do this, so this is just a placeholder for exposing memory utilization in JBOSS. c:\jboss-eap-5.1.2\jboss-eap-5.1\jboss-as\bin>twiddle.bat -u admin -p admin get jboss.system:type=ServerInfo | findstr Memory MaxMemory=3579183104 TotalMemory=3087007744 FreeMemory=2852457960 c:\jboss-eap-5.1.2\jboss-eap-5.1\jboss-as\bin>

Schema compare command line tool

I use what is below to quickly compare two Oracle database schema’s tables. It would be trivial to add indexes to the mix. import java.sql.*; import java.util.*; public class schemaDiffer { public static void main(String args[]) { try { Class.forName(“oracle.jdbc.driver.OracleDriver”);…

Print HTTP headers in ATG

ATG provides a class named InsertableServletImpl, which can do pretty much what it sounds like. You insert the servlet to be run in the ATG servlet pipeline where you dictate. This allows us to inject behavior into our application at…