Here's how we would achieve the same thing as the referenced blog using JDO and DataNucleus. Firstly lets create a class that equates to a row of data in the table.
public class SampleData
@PrimaryKey @Column(name="Employer Name")
public SampleData(String e, String d, String c)
this.employerName = e;
this.designation = d;
this.country = c;
Now we define our datastore persistence properties (datanucleus.properties)
Finally let's do some persistence
PersistenceManagerFactory pmf =
PersistenceManager pm = pmf.getPersistenceManager();
Transaction tx = pm.currentTransaction();
SampleData ds =
new SampleData(“Intelligent User”, “Software Engineer”, “Bolivia”);
and this generates the same output that was shown in the blog, just that the code is now readable, shorter, and uses standardised APIs, never mind the fact that you could conceivably just persist the same data to RDBMS, XML, ODF, ODBMS, Cassandra and many more datastores with a simple change of that datastore URL. Additionally it allows you to focus on objects, which is likely why you chose Java in the first place. Why put yourself through more pain ?
[Needless to say, DataNucleus would also allow you to do the same using JPA]