In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1import java.util.ArrayList;import java.util.List;import org.apache.ibatis.session.SqlSession;import cn.itcast.javaee.mybatis.util.MybatisUtil;/** * persistence layer * @ author AdminTC * / public class StudentDao {/ * insert student * / public void dynaInsert (Student student) throws Exception {SqlSession sqlSession = null; try {sqlSession = MybatisUtil.getSqlSession () SqlSession.insert ("studentNamespace.dynaInsert", student); sqlSession.commit ();} catch (Exception e) {e.printStackTrace (); sqlSession.rollback (); throw e;} finally {MybatisUtil.closeSqlSession ();}} public static void main (String [] args) throws Exception {StudentDao dao = new StudentDao () / / dao.dynaInsert (new Student (1, "", 7000D)); / / insert into table name (*, *, *) values (?,?) / / dao.dynaInsert (new Student (2, "", null)); / / insert into table name (*, *) values (?) / / dao.dynaInsert (new Student (3recollum 7000D)); / / insert into table name (*, *) values (?) Dao.dynaInsert (new Student (4flore null)) / / insert into table name (*) values (?)} 2 students_id, students_name, students_sal # {id}, # {name}, # {sal}, insert into students () values ()
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.