在Maven使用SSM框架實(shí)現(xiàn)對數(shù)據(jù)庫進(jìn)行增刪改查操作?相信很多沒有經(jīng)驗(yàn)的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個(gè)問題。
創(chuàng)新互聯(lián)是一家專注于成都做網(wǎng)站、網(wǎng)站建設(shè)與策劃設(shè)計(jì),祥符網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)10多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:祥符等地區(qū)。祥符做網(wǎng)站價(jià)格咨詢:028-86922220
Spring介紹:
spring 使用基本的 JavaBean 來完成以前只可能由 EJB 完成的事情。然而, Spring的用途不僅限于服務(wù)器端的開發(fā)。從簡單性、可測試性和松耦合的角度而言,任何Java 應(yīng)用都可以從 Spring 中受益。 簡單來說, Spring 是一個(gè)輕量級的控制反轉(zhuǎn)(IoC )和面向切面( AOP )的容器框架。
SpringMVC介紹
Spring MVC 屬于 SpringFrameWork 的后續(xù)產(chǎn)品,已經(jīng)融合在Spring Web Flow 里面。 Spring MVC 分離了 控制器 、模型 對象 、分派器以及處理程序?qū)ο蟮慕巧?,這種分離讓它們更容易進(jìn)行定制。
MyBatis介紹
MyBatis 本是 apache 的一個(gè)開源項(xiàng)目 iBatis , 2010 年這個(gè)項(xiàng)目由apache software foundation 遷移到了 google code ,并且改名為 MyBatis 。MyBatis 是一個(gè)基于 Java 的 持久層 框架。 iBATIS 提供的 持久層 框架包括SQL Maps 和 Data Access Objects ( DAO ) MyBatis 消除了幾乎所有的 JDBC 代碼和參數(shù)的手工設(shè)置以及結(jié)果集的檢索。 MyBatis 使用簡單的 XML 或注解用于配置和原始映射,將接口和 Java 的 POJOs ( Plain Old Java Objects ,普通的 Java 對象)映射成數(shù)據(jù)庫中的記錄。
首先不是maven架構(gòu)整合的 SSM 框架
創(chuàng)建數(shù)據(jù)庫、表db_zsl t_user user_t【最下面有sql語句】
1.項(xiàng)目整體結(jié)構(gòu)
2.添加相關(guān)jar 包
3.項(xiàng)目整體結(jié)構(gòu)出來了
4.創(chuàng)建model【User】
package comlytmodel; /** * 用戶 * @author * */ public class User { private int id; private String userName; private String age; @Override public String toString() { return "User [id=" + id + ", age=" + age + ", userName=" + userName + "]"; } public User(){ super(); } public int getId() { return id; } public void setId(int id) { thisid = id; } public String getAge() { return age; } public void setAge(String age) { thisage = age; } public String getUserName() { return userName; } public void setUserName(String userName) { thisuserName = userName; } public User(int id, String age, String userName) { super(); thisid = id; thisage = age; thisuserName = userName; } }
5.創(chuàng)建DAO接口【在mybatis中 mapper就相當(dāng)于dao】
package comlytmapper; import javautilList; import comlytmodelUser; /** * 做為 DAO的接口 * @author */ public interface UserMapper { void save(User user); boolean update(User user); boolean delete(int id); User findById(int id); List<User> findAll(); }
6.實(shí)現(xiàn)dao接口【mybatis中就是UserMapper.xml文件】
<?xml version="0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatisorg//DTD Mapper 0//EN" "http://mybatisorg/dtd/mybatis-3-mapperdtd"> <!-- namespace:必須與對應(yīng)的接口全類名一致 UserMapperjava id :必須與對應(yīng)接口的某個(gè)對應(yīng)的方法名一致即必須要和UserMapperjava接口中的方法同名。 --> <mapper namespace="comlytmapperUserMapper"> <insert id="save" parameterType="User"> insert into t_user(user_name,user_age) values(#{userName},#{age}) </insert> <update id="update" parameterType="User"> update t_user set user_name=#{userName},user_age=#{age} where user_id=#{id} </update> <delete id="delete" parameterType="int"> delete from t_user where user_id=#{id} </delete> <!-- mybsits_config中配置的alias類別名,也可直接配置resultType為類路徑 --> <select id="findById" parameterType="int" resultType="User"> select user_id id,user_name userName,user_age age from t_user where user_id=#{id} </select> <select id="findAll" resultType="User"> select user_id id,user_name userName,user_age age from t_user </select> </mapper>
這里對這個(gè)xml文件作幾點(diǎn)說明:
1、namespace必須與對應(yīng)的接口全類名一致。
2、id必須與對應(yīng)接口的某個(gè)對應(yīng)的方法名一致即必須要和UserMapper.java接口中的方法同名。
7.mybatis與Spring整合【spring-common.xml】放在src的根目錄下
對于Mybatis和Spring的整合是這篇博文的重點(diǎn),需要配置的內(nèi)容在下面有詳細(xì)的解釋。
<?xml version="0" encoding="UTF-8"?> <beans xmlns="http://wwwspringframeworkorg/schema/beans" xmlns:xsi="http://wwwworg/2001/XMLSchema-instance" xmlns:p="http://wwwspringframeworkorg/schema/p" xmlns:context="http://wwwspringframeworkorg/schema/context" xmlns:tx="http://wwwspringframeworkorg/schema/tx" xsi:schemaLocation=" http://wwwspringframeworkorg/schema/beans http://wwwspringframeworkorg/schema/beans/spring-beans-xsd http://wwwspringframeworkorg/schema/context http://wwwspringframeworkorg/schema/context/spring-context-xsd http://wwwspringframeworkorg/schema/tx http://wwwspringframeworkorg/schema/tx/spring-tx-xsd"> <!-- Mybatis和Spring的整合 --> <!-- 數(shù)據(jù)源 : DriverManagerDataSource --> <bean id="dataSource" class="orgspringframeworkjdbcdatasourceDriverManagerDataSource"> <property name="driverClassName" value="comMySQLjdbcDriver" /> <property name="url" value="jdbc:mysql://localhost:3306/db_zsl" /> <property name="username" value="root" /> <property name="password" value="root" /> </bean> <!-- mybatis的SqlSession的工廠: SqlSessionFactoryBean dataSource:引用數(shù)據(jù)源 MyBatis定義數(shù)據(jù)源,同意加載配置 --> <bean id="sqlSessionFactory" class="orgmybatisspringSqlSessionFactoryBean"> <property name="dataSource" ref="dataSource"></property> <property name="configLocation" value="classpath:mybatis-configxml" /> </bean> <!-- mybatis自動(dòng)掃描加載Sql映射文件/接口 : MapperScannerConfigurer sqlSessionFactory basePackage:指定sql映射文件/接口所在的包(自動(dòng)掃描) --> <bean class="orgmybatisspringmapperMapperScannerConfigurer"> <property name="basePackage" value="comlytmapper"></property> <property name="sqlSessionFactory" ref="sqlSessionFactory"></property> </bean> <!-- 事務(wù)管理 : DataSourceTransactionManager dataSource:引用上面定義的數(shù)據(jù)源 --> <bean id="txManager" class="orgspringframeworkjdbcdatasourceDataSourceTransactionManager"> <property name="dataSource" ref="dataSource"></property> </bean> <!-- 使用聲明式事務(wù) transaction-manager:引用上面定義的事務(wù)管理器 --> <tx:annotation-driven transaction-manager="txManager" /> </beans>
8.mybatis配置文件【mybatis-config.xml】放在src目錄下
<?xml version="0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC "-//mybatisorg//DTD Config 0//EN" "http://mybatisorg/dtd/mybatis-3-configdtd"> <configuration> <!-- 實(shí)體類,簡稱 -設(shè)置別名 --> <typeAliases> <typeAlias alias="User" type="comlytmodelUser" /> </typeAliases> <!-- 實(shí)體接口映射資源 --> <!-- 說明:如果xxMapperxml配置文件放在和xxMapperjava統(tǒng)一目錄下,mappers也可以省略,因?yàn)閛rgmybatisspringmapperMapperFactoryBean默認(rèn)會(huì)去查找與xxMapperjava相同目錄和名稱的xxMapperxml --> <mappers> <mapper resource="com/lyt/mapper/userMapperxml" /> </mappers> </configuration>
配置log4j.properties
### set log levels ### log4jrootLogger = info , Console , D #Console log4jappenderConsole=orgapachelog4jConsoleAppender log4jappenderConsolelayout=orgapachelog4jPatternLayout log4jappenderConsolelayoutConversionPattern=%d [%t] %-5p [%c] - %m%n log4jloggerjavasqlResultSet=INFO log4jloggerorgapache=INFO log4jloggerjavasqlConnection=INFO log4jloggerjavasqlStatement=INFO log4jloggerjavasqlPreparedStatement=INFO #output2file log4jappenderD = orgapachelog4jDailyRollingFileAppender log4jappenderDFile = D\:/logs/loglog log4jappenderDAppend = true log4jappenderDThreshold = INFO \#\# \u00E8\u00BE\u0093\u00E5\u0087\u00BAinfo\u00E7\u00BA\u00A7\u00E5\u0088\u00AB\u00E4\u00BB\u00A5\u00E4\u00B8\u008A\u00E7\u009A\u0084\u00E6\u0097\u00A5\u00E5\u00BF\u0097 log4jappenderDlayout = orgapachelog4jPatternLayout log4jappenderDlayoutConversionPattern = %-d{yyyy-MM-dd HH\:mm\:ss} [ %t\:%r ] - [ %p ] %m%n
10.整合Springmvc
配置【spring-mvc.xml】放在src根目錄下
<?xml version="0" encoding="UTF-8"?> <beans xmlns="http://wwwspringframeworkorg/schema/beans" xmlns:xsi="http://wwwworg/2001/XMLSchema-instance" xmlns:context="http://wwwspringframeworkorg/schema/context" xmlns:mvc="http://wwwspringframeworkorg/schema/mvc" xsi:schemaLocation="http://wwwspringframeworkorg/schema/beans http://wwwspringframeworkorg/schema/beans/spring-beansxsd http://wwwspringframeworkorg/schema/context http://wwwspringframeworkorg/schema/context/spring-context-xsd http://wwwspringframeworkorg/schema/mvc http://wwwspringframeworkorg/schema/mvc/spring-mvc-xsd"> <!-- 注解掃描包 --> <context:component-scan base-package="comlytcontroller" /> <context:component-scan base-package="comlytservice" /> <!-- 開啟注解 --> <mvc:annotation-driven /> <!-- 配置靜態(tài)資源,直接映射到對應(yīng)的文件夾,不被DispatcherServlet處理,04新增功能,需要重新設(shè)置spring-mvc-xsd --> <mvc:resources mapping="/img/**" location="/img/" /> <mvc:resources mapping="/js/**" location="/js/" /> <mvc:resources mapping="/css/**" location="/css/" /> <mvc:resources mapping="/html/**" location="/html/" /> <!-- 定義跳轉(zhuǎn)的文件的前后綴 ,視圖模式配置--> <bean id="viewResolver" class="orgspringframeworkwebservletviewInternalResourceViewResolver"> <!-- 這里的配置我的理解是自動(dòng)給后面action的方法return的字符串加上前綴和后綴,變成一個(gè) 可用的url地址 --> <property name="prefix" value="/WEB-INF/jsp/" /> <property name="suffix" value="jsp" /> </bean> </beans>
11.配置web.xml
<?xml version="0" encoding="UTF-8"?> <web-app version="5" xmlns="http://javasuncom/xml/ns/javaee" xmlns:xsi="http://wwwworg/2001/XMLSchema-instance" xsi:schemaLocation="http://javasuncom/xml/ns/javaee http://javasuncom/xml/ns/javaee/web-app_2_xsd"> <!-- 加載Spring容器配置 --> <listener> <listener-class>orgspringframeworkwebcontextContextLoaderListener</listener-class> </listener> <!-- 設(shè)置Spring容器加載所有的配置文件的路徑 --> <context-param> <param-name>contextConfigLocation</param-name> <!-- <param-value>classpath:config/spring-*xml</param-value> --> <param-value>classpath:spring-commonxml,classpath:spring-mvcxml</param-value> </context-param> <!-- 配置SpringMVC核心控制器 --> <servlet> <servlet-name>springMVC</servlet-name> <servlet-class>orgspringframeworkwebservletDispatcherServlet</servlet-class> <!-- 配置初始配置化文件,前面contextConfigLocation看情況二選一 --> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring-commonxml,classpath:spring-mvcxml</param-value> </init-param> <!-- 啟動(dòng)加載一次 --> <load-on-startup>1</load-on-startup> </servlet> <!--為DispatcherServlet建立映射 --> <servlet-mapping> <servlet-name>springMVC</servlet-name> <!-- 此處可以可以配置成*do,對應(yīng)struts的后綴習(xí)慣 --> <url-pattern>/</url-pattern> </servlet-mapping> <!-- 防止Spring內(nèi)存溢出監(jiān)聽器 --> <listener> <listener-class>orgspringframeworkwebutilIntrospectorCleanupListener</listener-class> </listener> <!-- 解決工程編碼過濾器 --> <filter> <filter-name>encodingFilter</filter-name> <filter-class>orgspringframeworkwebfilterCharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>indexjsp</welcome-file> </welcome-file-list> </web-app>
12.建立service以及service實(shí)現(xiàn)【UserService.java】
package comlytservice; import javautilList; import comlytmodelUser; public interface UserService { void save(User user); boolean update(User user); boolean delete(int id); User findById(int id); List<User> findAll(); }
【UserServiceImpl.java】
package comlytserviceimpl; import javautilList; import javaxannotationResource; import orgspringframeworkstereotypeService; import orgspringframeworktransactionannotationTransactional; import comlytmapperUserMapper; import comlytmodelUser; import comlytserviceUserService; @Service @Transactional // 此處不再進(jìn)行創(chuàng)建SqlSession和提交事務(wù),都已交由spring去管理了。 public class UserServiceImpl implements UserService { @Resource private UserMapper mapper; /** * 根據(jù) id 刪除 數(shù)據(jù) */ public boolean delete(int id) { return mapperdelete(id); } /** * 查詢User的全部數(shù)據(jù) */ public List<User> findAll() { List<User> findAllList = mapperfindAll(); return findAllList; } /** * 根據(jù) id 查詢 對應(yīng)數(shù)據(jù) */ public User findById(int id) { User user = mapperfindById(id); return user; } /** * 新增數(shù)據(jù) */ public void save(User user) { mappersave(user); } /** * 根據(jù) id 修改對應(yīng)數(shù)據(jù) */ public boolean update(User user) { return mapperupdate(user); } }
13.建立Controller【UserController.java】
package comlytcontroller; import javaioIOException; import javaioPrintWriter; import javautilList; import javaxservlethttpHttpServletRequest; import javaxservlethttpHttpServletResponse; import orgspringframeworkbeansfactoryannotationAutowired; import orgspringframeworkstereotypeController; import orgspringframeworkuiModel; import orgspringframeworkwebbindannotationRequestMapping; import comlytmodelUser; import comlytserviceUserService; @Controller @RequestMapping("/user") public class UserController { @Autowired private UserService userService; /** * 獲取所有用戶列表 * @param request * @return */ @RequestMapping("/getAllUser") public String getAllUser(HttpServletRequest request,Model model){ List<User> user = userServicefindAll(); modeladdAttribute("userList", user); requestsetAttribute("userList", user); return "/allUser"; } /** * 跳轉(zhuǎn)到添加用戶界面 * @param request * @return */ @RequestMapping("/toAddUser") public String toAddUser(){ return "/addUser"; } /** * 添加用戶并重定向 * @param user * @param request * @return */ @RequestMapping("/addUser") public String addUser(User user,Model model){ userServicesave(user); return "redirect:/user/getAllUser"; } /** *編輯用戶 * @param user * @param request * @return */ @RequestMapping("/updateUser") public String updateUser(User user,HttpServletRequest request,Model model){ if(userServiceupdate(user)){ user = userServicefindById(usergetId()); requestsetAttribute("user", user); modeladdAttribute("user", user); return "redirect:/user/getAllUser"; }else{ return "/error"; } } /** * 根據(jù)id查詢單個(gè)用戶 * @param id * @param request * @return */ @RequestMapping("/getUser") public String getUser(int id,HttpServletRequest request,Model model){ requestsetAttribute("user", userServicefindById(id)); modeladdAttribute("user", userServicefindById(id)); return "/editUser"; } /** * 刪除用戶 * @param id * @param request * @param response */ @RequestMapping("/delUser") public void delUser(int id,HttpServletRequest request,HttpServletResponse response){ String result = "{\"result\":\"error\"}"; if(userServicedelete(id)){ result = "{\"result\":\"success\"}"; } responsesetContentType("application/json"); try { PrintWriter out = responsegetWriter(); outwrite(result); } catch (IOException e) { eprintStackTrace(); } } }
至此 大部分架構(gòu)以及代碼已經(jīng)搭建完成
我們來做前臺(tái)頁面--修改index.jsp
<%@ page language="java" import="javautil*" pageEncoding="utf-8"%> <% String path = requestgetContextPath(); String basePath = requestgetScheme() + "://" + requestgetServerName() + ":" + requestgetServerPort() + path + "/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 01 Transitional//EN"> <html> <head> <base href="<%=basePath%>" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" > <title>首頁</title> </head> <body> <h6> <a href="<%=basePath%>user/getAllUser" rel="external nofollow" >進(jìn)入用戶管理頁</a> </h6> </body> </html>
在 WEB-INF 下新建jsp文件夾【里面新建以下文件】【addUser.jsp】【allUser.jsp】【editUser.jsp】
addUser.jsp內(nèi)容
<%@ page language="java" import="javautil*" pageEncoding="UTF-8"%> <% String path = requestgetContextPath(); String basePath = requestgetScheme()+"://"+requestgetServerName()+":"+requestgetServerPort()+path+"/"; %> <%@ taglib uri="http://javasuncom/jsp/jstl/core" prefix="c"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 01 Transitional//EN"> <html> <head> <base href="<%=basePath%>" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" > <title>添加用戶</title> <script type="text/javascript"> function addUser(){ var form = documentforms[0]; formaction = "<%=basePath%>user/addUser"; formmethod="post"; formsubmit(); } </script> </head> <body> <h2><%=path%>添加用戶<%=basePath%></h2> <form action="" name="userForm"> 姓名:<input type="text" name="userName"> 年齡:<input type="text" name="age"> <input type="button" value="添加" onclick="addUser()"> </form> </body> </html>
allUser.jsp
<%@ page language="java" import="javautil*" pageEncoding="UTF-8"%> <% String path = requestgetContextPath(); String basePath = requestgetScheme()+"://"+requestgetServerName()+":"+requestgetServerPort()+path+"/"; %> <%@ taglib uri="http://javasuncom/jsp/jstl/core" prefix="c"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 01 Transitional//EN"> <html> <head> <base href="<%=basePath%>" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" > <script type="text/javascript" src="js/jquery-js"></script> <title>用戶列表</title> <script type="text/javascript"> function del(id){ $get("<%=basePath%>user/delUser?id=" + id,function(data){ if("success" == dataresult){ alert("刪除成功"); windowlocationreload(); }else{ alert("刪除失敗"); } }); } </script> </head> <body> <h7><a href="<%=basePath%>user/toAddUser" rel="external nofollow" >添加用戶</a></h7> <table border="1"> <tbody> <tr> <th>姓名</th> <th>年齡</th> <th>操作</th> </tr> <c:if test="${!empty userList }"> <c:forEach items="${userList}" var="user"> <tr> <td>${useruserName }</td> <td>${userage }</td> <td> <a href="<%=basePath%>user/getUser?id=${userid}" rel="external nofollow" >編輯</a> <a href="javascript:del('${userid }')" rel="external nofollow" >刪除</a> </td> </tr> </c:forEach> </c:if> </tbody> </table> </body> </html>
editUser.jsp
<%@ page language="java" import="javautil*" pageEncoding="UTF-8"%> <% String path = requestgetContextPath(); String basePath = requestgetScheme()+"://"+requestgetServerName()+":"+requestgetServerPort()+path+"/"; %> <%@ taglib uri="http://javasuncom/jsp/jstl/core" prefix="c"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 01 Transitional//EN"> <html> <head> <base href="<%=basePath%>" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" > <title>編輯用戶</title> <script type="text/javascript"> function updateUser(){ var form = documentforms[0]; formaction = "<%=basePath%>user/updateUser"; formmethod="post"; formsubmit(); } </script> </head> <body> <h2>添加用戶</h2> <form action="" name="userForm"> <input type="hidden" name="id" value="${userid }"/> 姓名:<input type="text" name="userName" value="${useruserName }"/> 年齡:<input type="text" name="age" value="${userage }"/> <input type="button" value="編輯" onclick="updateUser()"/> </form> </body> </html>
到此 簡單的整合SSM 【基本的操作內(nèi)容已經(jīng)完成】
讓你們看下界面運(yùn)行,地址:http://localhost:8088/SpringMVC_Spring_mybatis/
首頁:
點(diǎn)擊編輯進(jìn)去:
點(diǎn)擊添加進(jìn)去:
由于我在網(wǎng)絡(luò)問題 圖片暫時(shí)沒有上傳上去。【現(xiàn)在我把圖片都正上去了,希望多多支持】
對應(yīng)的數(shù)據(jù)庫 表
/* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50515 Source Host : localhost:3306 Source Database : db_zsl Target Server Type : MYSQL Target Server Version : 50515 File Encoding : 65001 Date: 2016-05-16 16:10:51 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `t_user` -- ---------------------------- DROP TABLE IF EXISTS `t_user`; CREATE TABLE `t_user` ( `user_id` int(11) NOT NULL AUTO_INCREMENT, `user_name` varchar(20) NOT NULL, `user_age` varchar(20) NOT NULL, PRIMARY KEY (`user_id`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of t_user -- ---------------------------- INSERT INTO `t_user` VALUES ('2', '朱佳鵬', '25'); INSERT INTO `t_user` VALUES ('3', '傻狍子', '150'); INSERT INTO `t_user` VALUES ('4', 'jiuqiyuliang', '23'); INSERT INTO `t_user` VALUES ('5', 'jiuqiyuliang', '23'); INSERT INTO `t_user` VALUES ('6', 'jiuqiyuliang', '23'); INSERT INTO `t_user` VALUES ('7', 'jiuqiyuliang', '23'); INSERT INTO `t_user` VALUES ('9', 'liyintao123', '23123'); -- ---------------------------- -- Table structure for `user_t` -- ---------------------------- DROP TABLE IF EXISTS `user_t`; CREATE TABLE `user_t` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_name` varchar(40) NOT NULL, `password` varchar(255) NOT NULL, `age` int(4) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of user_t -- ---------------------------- INSERT INTO `user_t` VALUES ('1', '測試', 'sfasgfaf', '24');
看完上述內(nèi)容,你們掌握在Maven使用SSM框架實(shí)現(xiàn)對數(shù)據(jù)庫進(jìn)行增刪改查操作的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝各位的閱讀!
網(wǎng)站欄目:在Maven使用SSM框架實(shí)現(xiàn)對數(shù)據(jù)庫進(jìn)行增刪改查操作
文章分享:http://vcdvsql.cn/article44/pcdphe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供云服務(wù)器、網(wǎng)站排名、網(wǎng)站設(shè)計(jì)、網(wǎng)站設(shè)計(jì)公司、網(wǎng)站維護(hù)、營銷型網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)