/* * Created on 28/09/2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package com.novell.basf.minimal; import java.sql.*; import org.apache.log4j.*; /** * @author Administrator * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class JDBCCheckMinimal { public static int execute(String classe, String url, String user, String password,String varPOSITION,String varDEPARTMENT,String varLOCATION,String varAPP){ int result=-1; Category cat = Category.getInstance("MINIMAL"); PropertyConfigurator.configure("/log4jMINIMALNovell.properties"); try{ //cat.info("Comando:"+comando); Class.forName(classe); Connection con = DriverManager.getConnection(url,user,password); CallableStatement pstmt = con.prepareCall("{call minimalApp(?,?,?,?,?)}"); pstmt.setString(1,varPOSITION); pstmt.setString(2,varDEPARTMENT); pstmt.setString(3,varLOCATION); pstmt.setString(4,varAPP); pstmt.registerOutParameter(5,Types.INTEGER); pstmt.executeUpdate(); result=pstmt.getInt(5); con.close(); }catch (Exception e) { System.err.println(e); cat.info(e); result=-1; } return result; } }