From 82425a195b7b0de298202a69c0cd98fd15805485 Mon Sep 17 00:00:00 2001 From: pbarros Date: Wed, 11 Jan 2012 12:13:25 -0200 Subject: [PATCH] Classe Utilitaria para converter data SQL --- .../org/ufcspa/simdecs/util/UtilitarioSql.java | 35 ++++++++++++++++++++ 1 files changed, 35 insertions(+), 0 deletions(-) create mode 100644 src/java/org/ufcspa/simdecs/util/UtilitarioSql.java diff --git a/src/java/org/ufcspa/simdecs/util/UtilitarioSql.java b/src/java/org/ufcspa/simdecs/util/UtilitarioSql.java new file mode 100644 index 0000000..bb4d35c --- /dev/null +++ b/src/java/org/ufcspa/simdecs/util/UtilitarioSql.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package org.ufcspa.simdecs.util; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * + * @author pbarros + */ +public class UtilitarioSql { + + + public void UtilitarioSql() + { + } + + public java.sql.Date converteDataUtilToSql(Date data) { + SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy"); + Date dataUtil = data; + java.sql.Date dataSql = null; + try { + dataUtil = new java.sql.Date(dataUtil.getTime()); + dataSql = (java.sql.Date) dataUtil; + + } catch (Exception e) { + //JOptionPane.showMessageDialog(null, "Erro ao converte data para sql: " + e.getMessage()); + } + return dataSql; + } + +} -- 1.7.6.4