JTS

Dead Simple Java Web Services and Clients

If you are like me and have seen a ton of languages out there provide web services with a few simple instructions (Perl / PHP / Python), you may have the impression that it should be pretty easy in Java? Couple of lines of code and voila a server. A few more lines and voila a client that consumes said service. Unfortunately that does not seem to be the case in my experience. WDSL setup this…wimport that (but only with JDK’s greater than 1.6_05..).

Here is a dead simple way to setup clients and services in a few steps.

Read More

Apache Cayenne – Simple Count Query

I’m currently working on a project involved with using Apache Cayenne, a pretty lightweight ORM (object relationship mapping framework). So far I have been very impressed with its ease of use over other framework such as Hibernate and the minimalistic approach it takes to the mapping. Configuration files are used at a minimum and they are extremely easy to understand.

The one thing that I have found a bit lacking, are straightforward real world examples. While, the Java documentation is fantastic and there are only a few minimal “Getting Started” pages on the main website, I really couldn’t find a good example of some more complicated logic examples.

In anycase, here is some code that hopefully will save someone else a bit of time. This is an example of how to call a “NamedQuery” in Cayenne that accepts a single parameter and returns a count of rows for a particular table. This assumes at least a basic understanding of the Cayenne system and that you have at least been through the tutorial.

Read More

Netbeans 6.7 Database Explorer Timeout Workaround

I had small issue recently in that the Netbeans 6.7 database explorer was timing out just trying to connect to my production database. Apparently the Mysql server needs to respond back within a few mili-seconds and there are no configuration settings in Netbeans to increase this timeout. Our production database has an initial lag time when you first connect, but it is pretty zippy thereafter (I suspect my cheap home based switches or my Windows computer).

Read More

Quick PHP RSS Feeds

Here is a snippet of code that I wish I had when I needed to write a small routine to output a PHP RSS feed.
RSS Feeds are XML-like so they need to be carefully crafted.

1.) Setup the main header of the rss feed. Remember to carefully escape all of your text going into string
fields using htmlentities().

Read More