Index: PreparedStatement.java
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/PreparedStatement.java,v
retrieving revision 1.7
diff -c -r1.7 PreparedStatement.java
*** PreparedStatement.java	2001/06/11 22:11:59	1.7
--- PreparedStatement.java	2001/07/12 00:33:51
***************
*** 260,266 ****
  	{
  	  // if the passed string is null, then set this column to null
  	  if(x==null)
! 	    set(parameterIndex,"null");
  	  else {
  	    StringBuffer b = new StringBuffer();
  	    int i;
--- 260,266 ----
  	{
  	  // if the passed string is null, then set this column to null
  	  if(x==null)
! 	    setNull(parameterIndex,Types.OTHER);
  	  else {
  	    StringBuffer b = new StringBuffer();
  	    int i;
***************
*** 312,320 ****
  	 */
  	public void setDate(int parameterIndex, java.sql.Date x) throws SQLException
  	{
!           SimpleDateFormat df = new SimpleDateFormat("''yyyy-MM-dd''");
! 	  set(parameterIndex, df.format(x));
! 
  	  // The above is how the date should be handled.
  	  //
  	  // However, in JDK's prior to 1.1.6 (confirmed with the
--- 312,323 ----
  	 */
  	public void setDate(int parameterIndex, java.sql.Date x) throws SQLException
  	{
! 	  if (null == x){
! 		setNull(parameterIndex,Types.OTHER);
! 	  }else{
!             SimpleDateFormat df = new SimpleDateFormat("''yyyy-MM-dd''");
! 	    set(parameterIndex, df.format(x));
! 	  }
  	  // The above is how the date should be handled.
  	  //
  	  // However, in JDK's prior to 1.1.6 (confirmed with the
***************
*** 337,343 ****
--- 340,350 ----
  	 */
  	public void setTime(int parameterIndex, Time x) throws SQLException
  	{
+ 	  if (null == x){
+ 		setNull(parameterIndex,Types.OTHER);
+ 	  }else{
  		set(parameterIndex, "'" + x.toString() + "'");
+ 	  }
  	}
  
  	/**
***************
*** 350,360 ****
  	 */
  	public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException
          {
!           SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
!           df.setTimeZone(TimeZone.getTimeZone("GMT"));
!           StringBuffer strBuf = new StringBuffer("'");
!           strBuf.append(df.format(x)).append('.').append(x.getNanos()/10000000).append("+00'");
! 	  set(parameterIndex, strBuf.toString());
  	}
  
  	/**
--- 357,371 ----
  	 */
  	public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException
          {
! 	  if (null == x){
! 		setNull(parameterIndex,Types.OTHER);
! 	  }else{
!             SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
!             df.setTimeZone(TimeZone.getTimeZone("GMT"));
!             StringBuffer strBuf = new StringBuffer("'");
!             strBuf.append(df.format(x)).append('.').append(x.getNanos()/10000000).append("+00'");
! 	    set(parameterIndex, strBuf.toString());
! 	  }
  	}
  
  	/**
