aspose file tools
The moose likes Spring and the fly likes JdbcTmplate.update and POJO data type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "JdbcTmplate.update and POJO data type" Watch "JdbcTmplate.update and POJO data type" New topic

JdbcTmplate.update and POJO data type

FY Hsieh
Ranch Hand

Joined: Aug 07, 2006
Posts: 73
I saw some spring jdbc code like

if I have

class Member {
private String name;
private String address;
private int zip;
private int age;

question --- Using this approach, what if I want to pass null value to zip ?
Does that mean I HAVE to use

private Integer zip;

instead ??

is it true we usually should use wrapper class instead of int, double, etc data type in the POJO so that we can handle passing NULL value ?

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17268



I love short answers. ;)

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
It is sorta covered in the JavaRanch Style Guide.
subject: JdbcTmplate.update and POJO data type