Struts data source configuration and call method

xiaoxiao2021-03-06  20

Configure as follows: call method is: import java.sql.datasource; DataSourece DS = (DataSource) servlet.getServletContext (). GetAttribute ("org.apache.struts .action.data_source "); connection conn = ds.getConnection (); preparedStatement PSTMT = conn.preparestatement (" select * from test "); ResultSet RS = pstmt.executeQuery () This is OK.

转载请注明原文地址:https://www.9cbs.com/read-59397.html

New Post(0)