1. A computer-implemented method for performing a database query by using a user-defined function (UDF), comprising: detecting whether a command for invoking the UDF, by a relational database management system (RDBMS), to transmit a parameter value has been received; based on detecting that the command for invoking the UDF to transmit the parameter value has been received: starting a first interface that is a transmitting interface of the UDF; receiving the parameter value through the first interface; transmitting the received parameter value through the first interface to an external data source; and returning to detecting whether the command for invoking the UDF to transmit the parameter value has been received; detecting whether data can be received; based on detecting that the data can be received: starting a second interface that is a receiving interface of the UDF, the second interface operating asynchronously with respect to the first interface, and the first and second interfaces are threads of the UDF created by the RDBMS; creating, by the RDBMS, a buffer in the UDF at runtime; receiving the data from the external data source through the second interface, wherein the received data is obtained from the external data source in response to the transmitting of the received parameter value to the external data source through the first interface; and storing, by the second interface, the data received from the external data source into the buffer; detecting whether stored data has been received from the external source based on monitoring the buffer; and based on detecting that the stored data has been received from the external data source, providing the data received from the external data source by copying contents of the buffer.