From b375dd59a4ab84dea22cbc0409a2a318718d1039 Mon Sep 17 00:00:00 2001 From: pbarros Date: Fri, 13 Jan 2012 18:01:49 -0200 Subject: [PATCH] Alterado pacote com classe utilitaria --- .../simdecs/comunicacao/util/UtilitarioSql.java | 35 ++++++++++++++++++++ 1 files changed, 35 insertions(+), 0 deletions(-) create mode 100644 src/java/org/ufcspa/simdecs/comunicacao/util/UtilitarioSql.java diff --git a/src/java/org/ufcspa/simdecs/comunicacao/util/UtilitarioSql.java b/src/java/org/ufcspa/simdecs/comunicacao/util/UtilitarioSql.java new file mode 100644 index 0000000..548489a --- /dev/null +++ b/src/java/org/ufcspa/simdecs/comunicacao/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.comunicacao.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