0
我創建了一個簡單的Web服務。那麼現在完成了,我必須將事情複雜化:連接到MySQL數據庫並通過Web服務與它通信! 我無法在互聯網上找到如何與我的Web服務建立連接(當沒有Web服務時,我知道這很好,它是一個簡單的Java應用程序)。但是在web服務中我沒有main
這個問題,只是方法。將SQL集成到Java中的Web服務中
這是我的代碼的一部分:
package impression;
import java.sql.*;
import java.util.Date;
import javax.jws.Oneway;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
@WebService(serviceName = "impression")
public class impression {
@WebMethod(operationName = "EnvoiMessage")
public String messageReception(@WebParam(name = "msg") String msg) {
msg="Demande recu!";
return msg;
}
/**
* Web service operation
*/
@WebMethod(operationName = "affichageDemande")
@Oneway
public void affichageDemande() {
//here i want to display the table created im my database
}
}
我會很感激,如果你能幫助我。
非常感謝:) – user3479776