Beispiel #1
0
 @Override
 public byte[] getServiceInfo(
     ServiceParameterBuffer serviceParameterBuffer,
     ServiceRequestBuffer serviceRequestBuffer,
     int maxBufferLength)
     throws SQLException {
   try {
     final byte[] serviceParameterBufferBytes =
         serviceParameterBuffer == null ? null : serviceParameterBuffer.toBytesWithType();
     final byte[] serviceRequestBufferBytes =
         serviceRequestBuffer == null ? null : serviceRequestBuffer.toBytes();
     final ByteBuffer responseBuffer = ByteBuffer.allocateDirect(maxBufferLength);
     synchronized (getSynchronizationObject()) {
       clientLibrary.isc_service_query(
           statusVector,
           handle,
           new IntByReference(0),
           (short) (serviceParameterBufferBytes != null ? serviceParameterBufferBytes.length : 0),
           serviceParameterBufferBytes,
           (short) (serviceRequestBufferBytes != null ? serviceRequestBufferBytes.length : 0),
           serviceRequestBufferBytes,
           (short) maxBufferLength,
           responseBuffer);
       processStatusVector();
     }
     byte[] responseArray = new byte[maxBufferLength];
     responseBuffer.get(responseArray);
     return responseArray;
   } catch (SQLException e) {
     exceptionListenerDispatcher.errorOccurred(e);
     throw e;
   }
 }
Beispiel #2
0
 @Override
 public void startServiceAction(ServiceRequestBuffer serviceRequestBuffer) throws SQLException {
   try {
     final byte[] serviceRequestBufferBytes =
         serviceRequestBuffer == null ? null : serviceRequestBuffer.toBytes();
     synchronized (getSynchronizationObject()) {
       clientLibrary.isc_service_start(
           statusVector,
           handle,
           new IntByReference(0),
           (short) (serviceRequestBufferBytes != null ? serviceRequestBufferBytes.length : 0),
           serviceRequestBufferBytes);
       processStatusVector();
     }
   } catch (SQLException e) {
     exceptionListenerDispatcher.errorOccurred(e);
     throw e;
   }
 }