Here you can find the source of quoteMySQLDataField(Timestamp fieldData)
public static String quoteMySQLDataField(Timestamp fieldData)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 SirLordT <sirlordt@gmail.com>. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v2.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html * //from www .ja v a2s .c om * Contributors: * SirLordT <sirlordt@gmail.com> - initial API and implementation ******************************************************************************/ import java.sql.Timestamp; public class Main { public static String quoteMySQLDataField(Timestamp fieldData) { String strResult = ""; if (fieldData != null) strResult = "\"" + fieldData + "\""; else strResult = "null"; return strResult; } public static String quoteMySQLDataField(java.sql.Date fieldData) { String strResult = ""; if (fieldData != null) strResult = "\"" + fieldData + "\""; else strResult = "null"; return strResult; } public static String quoteMySQLDataField(java.sql.Time fieldData) { String strResult = ""; if (fieldData != null) strResult = "\"" + fieldData + "\""; else strResult = "null"; return strResult; } }