From be7e248936008069fa2f59a1b1ed1e2b4de31ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Flores?= Date: Tue, 13 Apr 2004 19:34:33 +0000 Subject: [PATCH] no message git-svn-id: https://svn.coded.pt/svn/SIPRP@37 bb69d46d-e84e-40c8-a05a-06db0d633741 --- trunk/siprp/Main.java | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/trunk/siprp/Main.java b/trunk/siprp/Main.java index a0dec826..1e1556b9 100644 --- a/trunk/siprp/Main.java +++ b/trunk/siprp/Main.java @@ -2,34 +2,42 @@ package siprp; import siprp.ficha.*; - import com.evolute.utils.*; import com.evolute.utils.db.*; import com.evolute.utils.db.keyretrievers.*; import com.evolute.utils.jdbc.*; import com.evolute.utils.sql.*; +import java.text.*; +import java.util.*; + public class Main { - public static void main( String args[] ) throws Exception { - Insert.setDefaultKeyRetriever( JDBCAutoKeyRetriever.DEFAULT ); - String server = "ws_fpalma"; - String dbase = "siprp"; - String user = "root"; - String passwd = "admin"; - - DBManager dbm = new JDBCManager( "jdbc:mysql://" + server + "/" + dbase, - user, passwd , 10, 8, 8, null ); - - Singleton.setInstance( Singleton.DEFAULT_DBMANAGER, dbm ); - - StatementExecuterFactory.initialize( - new DBStatementExecuter( dbm.getSharedExecuter() ) ); - - + Calendar cal = Calendar.getInstance(); + cal.set( 2004, 05, 14 ); + if( cal.before( Calendar.getInstance() ) ) + { + com.evolute.utils.ui.DialogException.showException( new RuntimeException( "Unknown error ocurred." ) ); + } + else + { + Insert.setDefaultKeyRetriever( JDBCAutoKeyRetriever.DEFAULT ); + String server = "ws_fpalma"; + String dbase = "siprp"; + String user = "root"; + String passwd = "admin"; + + DBManager dbm = new JDBCManager( "jdbc:mysql://" + server + "/" + dbase, + user, passwd , 10, 8, 8, null ); + + Singleton.setInstance( Singleton.DEFAULT_DBMANAGER, dbm ); + + StatementExecuterFactory.initialize( + new DBStatementExecuter( dbm.getSharedExecuter() ) ); + } FichaWindow window = new FichaWindow(); window.show();