
org.postgresql.adba.communication.network.ExecuteRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pgadba Show documentation
Show all versions of pgadba Show documentation
ADBA implementation for PostgreSQL
The newest version!
package org.postgresql.adba.communication.network;
import org.postgresql.adba.communication.FrontendTag;
import org.postgresql.adba.communication.NetworkOutputStream;
import org.postgresql.adba.communication.NetworkRequest;
import org.postgresql.adba.communication.NetworkResponse;
import org.postgresql.adba.communication.NetworkWriteContext;
import org.postgresql.adba.util.BinaryHelper;
/**
* Execute {@link NetworkRequest}.
*
* @author Daniel Sagenschneider
*/
public class ExecuteRequest implements NetworkRequest {
private final Portal portal;
public ExecuteRequest(Portal portal) {
this.portal = portal;
}
/*
* ================= NetworkRequest =========================
*/
@Override
public NetworkRequest write(NetworkWriteContext context) throws Exception {
// Obtain the query details
NetworkOutputStream wire = context.getOutputStream();
wire.write(FrontendTag.EXECUTE.getByte());
wire.initPacket();
wire.write(portal.getPortalName());
wire.write(BinaryHelper.writeInt(0)); // number of rows to return, 0 == all
wire.completePacket();
// TODO Auto-generated method stub
return new SyncRequest(portal);
}
@Override
public NetworkResponse getRequiredResponse() {
return new ExecuteResponse(portal);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy