It seems that I have either asked a obscure or difficult question or I have asked it in the wrong manner of place. At any rate after much hair pulling I found the answer to this question. My original code that actually attempts to CreateAMember
here:
public void createAMember(int memberid, String name, String address1, String address2, String town, String contact_number, int bookallowance, double balance, boolean active) {
String SQL = "insert into member (id,name,address1,address2,town,contact_number,book_allowance, balance, active) values (?,?,?,?,?,?,?, ?, ?)";
getJdbcTemplate().update(SQL, new Object[] { memberid,name,address1,address2,town,contact_number,bookallowance,balance,active});
System.out.println("Created Member Name = " + name + " memberid= " + memberid);
//throw new libException();
Must be structured more neatly and while identifying types and putting it neatly within a prepared statement. The below re-jigging worked for me.
PreparedStatementCreatorFactory psc=new PreparedStatementCreatorFactory(SQL);
psc.addParameter(new SqlParameter("id", Types.INTEGER));
psc.addParameter(new SqlParameter("name", Types.VARCHAR));
psc.addParameter(new SqlParameter("address1", Types.VARCHAR));
psc.addParameter(new SqlParameter("address2", Types.VARCHAR));
psc.addParameter(new SqlParameter("contact_number", Types.VARCHAR));
psc.addParameter(new SqlParameter("book_allowance", Types.INTEGER));
psc.addParameter(new SqlParameter("balance", Types.DOUBLE));
psc.addParameter(new SqlParameter("active", Types.BOOLEAN));
Object[] params=new Object[]{memberid,name, address1, address2, town, contact_number, bookallowance, balance,active};
KeyHolder holder = new GeneratedKeyHolder();
getJdbcTemplate().update(psc.newPreparedStatementCreator(params), holder);
System.out.println("holder:"+holder.getKey().toString());
System.out.println("Created Record Name = " + name + " ID = " + memberid);
My original method was fine for plain JDBC interaction and this is where the confusion arose. Transactions need the structure as shown above. I hope this post may assist an ignorant so and so like myself at some point.