mysql 数据源

 // struts config .xml

 
   

     

     

     

     

     

     

     

     

     

     

   

 

//java codes

 ServletContext sc=servlet.getServletContext();
  
  DataSource dataSource=(DataSource)sc.getAttribute("mysql");

   Connection conn=dataSource.getConnection();
   Statement stmt=conn.createStatement();
   ResultSet rs=stmt.executeQuery("select * from

你可能感兴趣的:(mysql 数据源)