insert null for DATETIME Field through PrepareStatement using jdbc
i want to insert null value into an DATETIME Field through PrepareStatement using JDBC (using Mysql Database) i have tried following ways but nothing is worked. i have a method " Util.dateconvertdate " it use to convert input date into a formatted string type public static String dateconvertdate(Timestamp timestamp) { Date date=null; String formattedDate=""; if(timestamp != null){ SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy hh:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); Date date1 = new java.util.Date(timestamp.getTime()); formattedDate =