Q:

What should the type of parameter be in Java when it is a "timestamp without time zone" in postgresql?

I am trying to run a query in postgresql through Java and JDBC.
The "activitydate" column of "table" in postgresql is "timestamp without time zone". I tried to use String to pass the date but didn't work(org.postgresql.util.PSQLException: ERROR: operator does not exist: timestamp without time zone > character varying).
What type instead of String should I use to store "start_date" and "end_date" and pass them to the query?
BTW SELECT COUNT(*) FROM table WHERE activitydate > '2014-11-20' AND activitydate < '2014-11-21' AND zipcode = 12345 runs perfectly in pgadmin.
public Response query(
          @QueryParam("start_date") String start_date,
          @QueryParam("end_date") String end_date,
          @QueryParam("zipcode") String zipcode
          ) throws Exception {
...
...

pstmt = conn.prepareStatement("SELECT COUNT(*) FROM table WHERE activitydate > ? AND activitydate < ? AND zipcode = ?");

pstmt.setString(1, start_date); 
pstmt.setString(2, end_date); 
pstmt.setString(3, zipcode); 

Update:
I changed it to java.sql.Timestamp but still doesn't work:
public Response query(
          @QueryParam("start_date") Timestamp start_date,
          @QueryParam("end_date") Timestamp end_date,
          @QueryParam("zipcode") String zipcode
          ) throws Exception {
...
...

pstmt = conn.prepareStatement("SELECT COUNT(*) FROM table WHERE activitydate > ? AND activitydate < ? AND zipcode = ?");

pstmt.setTimestamp(1, start_date); 
pstmt.setTimestamp(2, end_date); 
pstmt.setString(3, zipcode);

A:

You have to use a java.sql.Timestamp or a java.sql.Date.

