AllgemDBAccess | Lenpaste

PHOTO EMBED

Sun Oct 02 2022 16:49:08 GMT+0000 (Coordinated Universal Time)

Saved by @Sheldon

  1
/* ---------------------------------------------------------------------------

  2
	Projekt:       Public (Java)

  3


  4
	Klasse:			AllgemDBAccess

  5
	Paket:			Allgemein

  6


  7
	Beschreibung:  Diese Klasse implementiert allgemeine DB-Zugriffe fuer Java

  8
						JDBC.

  9


 10
	Autor:         SE/bd          Juli 1998         

 11
	Rev:

 12
   -------------------------------------------------------------------------*/

 13


 14
package Allgemein;

 15


 16
import java.sql.*;

 17


 18
public class AllgemDBAccess {

 19


 20
  public AllgemDBAccess() {

 21
		;

 22
  }

 23


 24
  public void debOut(Connection conn,String sDeb) throws UserException {

 25
   try {

 26
      CallableStatement cstmt = conn.prepareCall

 27
         ("{ call pck_message_proz.ipr_debug_message ( ? ) }");

 28
			cstmt.setString(1,sDeb);

 29
         ResultSet rs = cstmt.executeQuery();

 30
			cstmt.close();

 31
    } catch (java.sql.SQLException e2) {

 32
          String SQLEInfo = new String("debOut, ErrCode=");

 33
          SQLEInfo = SQLEInfo + e2.getErrorCode();

 34
          SQLEInfo = SQLEInfo + " ,Message:"  + e2.getMessage();

 35
          SQLEInfo = SQLEInfo + ", SQLState:" + e2.getSQLState();

 36
          throw new UserOracleException(true,

 37
                              e2.getErrorCode(),SQLEInfo);

 38
    }

 39
  } // end Method 'debOut'

 40


 41
  public void protokollOut(Connection conn,String sPrt) throws UserException {

 42
   try {

 43
      CallableStatement cstmt = conn.prepareCall

 44
         ("{ call pck_message_proz.ipr_protokoll_message ( ? ) }");

 45
			cstmt.setString(1,sPrt);

 46
         ResultSet rs = cstmt.executeQuery();

 47
			cstmt.close();

 48
    } catch (java.sql.SQLException e2) {

 49
          String SQLEInfo = new String("protokollOut, ErrCode=");

 50
          SQLEInfo = SQLEInfo + e2.getErrorCode();

 51
          SQLEInfo = SQLEInfo + " ,Message:"  + e2.getMessage();

 52
          SQLEInfo = SQLEInfo + ", SQLState:" + e2.getSQLState();

 53
          throw new UserOracleException(true,

 54
                              e2.getErrorCode(),SQLEInfo);

 55
    }

 56
  } // end Method 'protokollOut'

 57


 58
  public void fehlerOut(Connection conn,String sFehl) throws UserException {

 59
   try {

 60
      CallableStatement cstmt = conn.prepareCall

 61
         ("{ call pck_message_proz.ipr_fehler_message ( ? ) }");

 62
			cstmt.setString(1,sFehl);

 63
         ResultSet rs = cstmt.executeQuery();

 64
			cstmt.close();

 65
    } catch (java.sql.SQLException e2) {

 66
          String SQLEInfo = new String("fehlerOut, ErrCode=");

 67
          SQLEInfo = SQLEInfo + e2.getErrorCode();

 68
          SQLEInfo = SQLEInfo + " ,Message:"  + e2.getMessage();

 69
          SQLEInfo = SQLEInfo + ", SQLState:" + e2.getSQLState();

 70
          throw new UserOracleException(true,

 71
                              e2.getErrorCode(),SQLEInfo);

 72
    }

 73
  } // end Method 'fehlerOut'

 74


 75
  public void fehlerMeldungOut(Connection conn,int nFnr,String sZusTxt) 

 76
																	throws UserException {

 77
   try {

 78
      CallableStatement cstmt = conn.prepareCall

 79
         ("{ call pck_message_proz.ipr_fehlermeldung_ausgeben ( ? , ? ) }");

 80
			cstmt.setInt(1,nFnr);

 81
			cstmt.setString(2,sZusTxt);

 82
         ResultSet rs = cstmt.executeQuery();

 83
			cstmt.close();

 84
    } catch (java.sql.SQLException e2) {

 85
          String SQLEInfo = new String("fehlerMeldungOut, ErrCode=");

 86
          SQLEInfo = SQLEInfo + e2.getErrorCode();

 87
          SQLEInfo = SQLEInfo + " ,Message:"  + e2.getMessage();

 88
          SQLEInfo = SQLEInfo + ", SQLState:" + e2.getSQLState();

 89
          throw new UserOracleException(true,

 90
                              e2.getErrorCode(),SQLEInfo);

 91
    }

 92
  } // end Method 'fehlerMeldungOut'

 93


 94
  public void reportFortschritt(Connection conn,int nIter,

 95
										  String sZusTxt,boolean bForce) 

 96
																	throws UserException {

 97
   try {

 98
      CallableStatement cstmt = conn.prepareCall

 99
         ("{ call pck_message_proz.ipr_report_fortschritt_h ( ? , ? , ? ) }");

100
			cstmt.setInt(1,nIter);

101
			cstmt.setString(2,sZusTxt);

102
			cstmt.setInt(3, ((bForce) ? 1 : 0));

103
         ResultSet rs = cstmt.executeQuery();

104
			cstmt.close();

105
    } catch (java.sql.SQLException e2) {

106
          String SQLEInfo = new String("reportFortschritt, ErrCode=");

107
          SQLEInfo = SQLEInfo + e2.getErrorCode();

108
          SQLEInfo = SQLEInfo + " ,Message:"  + e2.getMessage();

109
          SQLEInfo = SQLEInfo + ", SQLState:" + e2.getSQLState();

110
          throw new UserOracleException(true,

111
                              e2.getErrorCode(),SQLEInfo);

112
    }

113
  } // end Method 'reportFortschritt'

114


115
} // end Class 'AllgemDBAccess'

116


117


118


119


120


121


122

content_copyCOPY

http://192.168.1.99:8249/QJWDmxDP