当前位置: 首页 > news >正文

电子商务网站栏目搜索引擎营销的特点有

电子商务网站栏目,搜索引擎营销的特点有,免费做产品宣传的网站,网站项目建设合同1.MyBatis 入门程序开发步骤 SqlSession:代表Java程序和数据库之间的会话。(HttpSession是Java程序和浏览器之间的会话) SqlSessionFactory:是“生产”SqlSession的“工厂”。 工厂模式:如果创建某一个对象&#xff…

1.MyBatis 入门程序开发步骤

  • SqlSession:代表Java程序和数据库之间的会话。(HttpSession是Java程序和浏览器之间的会话)

  • SqlSessionFactory:是“生产”SqlSession的“工厂”。

  • 工厂模式:如果创建某一个对象,使用的过程基本固定,那么我们就可以把创建这个对象的相关代码封装到一个“工厂类”中,以后都使用这个工厂类来“生产”我们需要的对象。

注意1:默认采⽤的事务管理器是:JDBC。JDBC事务默认是不提交的,需要⼿动提交。

public void addStu() {//1:第一步:mybatis提供了一个专门用来从java程序连接mysql数据库的对象SqlSessionFactoryBuilder sqlSessionFactoryBuilder = new SqlSessionFactoryBuilder();//2:创建qlSessionFactoryInputStream is = StudentTest.class.getClassLoader().getResourceAsStream("mybatis-config.xml");//InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("mybatis-config.xml");
//InputStream is = Resources.getResourceAsStream("mybatis-config.xml");SqlSessionFactory sqlSessionFactory = sqlSessionFactoryBuilder.build(is);// 3. 创建SqlSession对象SqlSession sqlSession = sqlSessionFactory.openSession(); //喏自动提交括号写true//4: 执行sql语句  受影响的行数sqlSession.insert(""); sqlSession.commit();sqlSession.close();}

2..引入日志框架logback

引⼊⽇志框架的⽬的是为了看清楚mybatis执⾏的具体sql。 启⽤标准⽇志组件,只需要在1.mybatis-config.xml⽂件中添加以下配置:【可参考mybatis⼿册】

mybatis-config.xml

<settings><setting name="logImpl" value="STDOUT_LOGGING" />
</settings>

2.引⼊logback相关依赖

<dependency><groupId>ch.qos.logback</groupId><artifactId>logback-classic</artifactId><version>1.2.11</version><scope>test</scope>
</dependency

3.引⼊logback相关配置⽂件(⽂件名叫做logback.xml或logback-test.xml,放到类路径 当中)

logback.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false"><!--定义⽇志⽂件的存储地址--><property name="LOG_HOME" value="/home"/><!-- 控制台输出 --><appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"><encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncode
r"><!--格式化输出:%d表示⽇期,%thread表示线程名,%-5level:级别从左显示5
个字符宽度%msg:⽇志消息,%n是换⾏符--><pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logge
r{50} - %msg%n</pattern></encoder></appender><!-- 按照每天⽣成⽇志⽂件 --><appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAp
pender"><rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRolling
Policy"><!--⽇志⽂件输出的⽂件名--><FileNamePattern>${LOG_HOME}/TestWeb.log.%d{yyyy-MM-dd}.log</FileNamePattern><!--⽇志⽂件保留天数--><MaxHistory>30</MaxHistory></rollingPolicy><encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncode
r"><!--格式化输出:%d表示⽇期,%thread表示线程名,%-5level:级别从左显示5
个字符宽度%msg:⽇志消息,%n是换⾏符--><pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logge
r{50} - %msg%n</pattern></encoder><!--⽇志⽂件最⼤的⼤⼩--><triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTrig
geringPolicy"><MaxFileSize>100MB</MaxFileSize></triggeringPolicy></appender><!--mybatis log configure--><logger name="com.apache.ibatis" level="TRACE"/><logger name="java.sql.Connection" level="DEBUG"/><logger name="java.sql.Statement" level="DEBUG"/><logger name="java.sql.PreparedStatement" level="DEBUG"/>
<!-- ⽇志输出级别,logback⽇志级别包括五个:TRACE < DEBUG < INFO < WARN < ER
ROR --><root level="DEBUG"><appender-ref ref="STDOUT"/><appender-ref ref="FILE"/></root>
</configuration>

3.MyBatis⼯具类SqlSessionUtil的封装

public class SqlSessionUtil {private static SqlSessionFactory sqlSessionFactory;/*** 类加载时初始化sqlSessionFactory对象*/static {try {SqlSessionFactoryBuilder sqlSessionFactoryBuilder = new SqlSes
sionFactoryBuilder();sqlSessionFactory = sqlSessionFactoryBuilder.build(Resources.g
etResourceAsStream("mybatis-config.xml"));} catch (Exception e) {e.printStackTrace();}}/*** 每调⽤⼀次openSession()可获取⼀个新的会话,该会话⽀持⾃动提交。** @return 新的会话对象*/public static SqlSession openSession() {return sqlSessionFactory.openSession(true);}
}


文章转载自:
http://dinncophylloerythrin.ssfq.cn
http://dinncomegalosaur.ssfq.cn
http://dinncodeclivous.ssfq.cn
http://dinncoshoes.ssfq.cn
http://dinncounderrepresentation.ssfq.cn
http://dinncoxylose.ssfq.cn
http://dinncopriesthood.ssfq.cn
http://dinncodetermined.ssfq.cn
http://dinncoblacklist.ssfq.cn
http://dinncoburlesque.ssfq.cn
http://dinncomulattress.ssfq.cn
http://dinncoindifferently.ssfq.cn
http://dinncodernier.ssfq.cn
http://dinncoabettor.ssfq.cn
http://dinncokistvaen.ssfq.cn
http://dinncobaykal.ssfq.cn
http://dinncocatachrestial.ssfq.cn
http://dinncooccupant.ssfq.cn
http://dinncotriene.ssfq.cn
http://dinncolacrosse.ssfq.cn
http://dinncochiseler.ssfq.cn
http://dinncoforman.ssfq.cn
http://dinncoruralism.ssfq.cn
http://dinncoreplicon.ssfq.cn
http://dinncojuridic.ssfq.cn
http://dinncoestivate.ssfq.cn
http://dinncoheedfully.ssfq.cn
http://dinncofluidounce.ssfq.cn
http://dinncosurgeoncy.ssfq.cn
http://dinncowhiffletree.ssfq.cn
http://dinncopyrometallurgy.ssfq.cn
http://dinncocheerleading.ssfq.cn
http://dinncoallover.ssfq.cn
http://dinncopreengage.ssfq.cn
http://dinncoatebrin.ssfq.cn
http://dinncopicador.ssfq.cn
http://dinncoenring.ssfq.cn
http://dinncoattest.ssfq.cn
http://dinncosallowy.ssfq.cn
http://dinncosiangtan.ssfq.cn
http://dinncosettee.ssfq.cn
http://dinncoleigh.ssfq.cn
http://dinncodegust.ssfq.cn
http://dinncogoldstar.ssfq.cn
http://dinncocolourbearer.ssfq.cn
http://dinncooverreliance.ssfq.cn
http://dinncogoldeye.ssfq.cn
http://dinncononinitially.ssfq.cn
http://dinnconephanalysis.ssfq.cn
http://dinncoexurb.ssfq.cn
http://dinncosonagraph.ssfq.cn
http://dinncoflic.ssfq.cn
http://dinncosite.ssfq.cn
http://dinncotilefish.ssfq.cn
http://dinncogramarie.ssfq.cn
http://dinncoschnauzer.ssfq.cn
http://dinncoclosehanded.ssfq.cn
http://dinncotetrabranchiate.ssfq.cn
http://dinncoexurbanite.ssfq.cn
http://dinncocompliancy.ssfq.cn
http://dinncostrident.ssfq.cn
http://dinncoadded.ssfq.cn
http://dinncobriar.ssfq.cn
http://dinncogoup.ssfq.cn
http://dinncocrapy.ssfq.cn
http://dinncodilatory.ssfq.cn
http://dinncosemidigested.ssfq.cn
http://dinncothorium.ssfq.cn
http://dinncoearthlubber.ssfq.cn
http://dinncocounterglow.ssfq.cn
http://dinncoabsinthism.ssfq.cn
http://dinncofelicitously.ssfq.cn
http://dinncoelectropolar.ssfq.cn
http://dinncosaliferous.ssfq.cn
http://dinncounalienated.ssfq.cn
http://dinncoairfare.ssfq.cn
http://dinncorivel.ssfq.cn
http://dinncoprocephalic.ssfq.cn
http://dinncomeltability.ssfq.cn
http://dinncoorthoepical.ssfq.cn
http://dinncocommonwealth.ssfq.cn
http://dinncoharbinger.ssfq.cn
http://dinncodivorce.ssfq.cn
http://dinncovolcanological.ssfq.cn
http://dinncoglowboy.ssfq.cn
http://dinncosputum.ssfq.cn
http://dinncounquestioned.ssfq.cn
http://dinncocalix.ssfq.cn
http://dinncoplanation.ssfq.cn
http://dinncorainbox.ssfq.cn
http://dinncoventail.ssfq.cn
http://dinncometaldehyde.ssfq.cn
http://dinncoptyalagogue.ssfq.cn
http://dinncobanefully.ssfq.cn
http://dinncomirthquake.ssfq.cn
http://dinncopredorsal.ssfq.cn
http://dinncocharacteristic.ssfq.cn
http://dinncoland.ssfq.cn
http://dinncohaemolyse.ssfq.cn
http://dinncohoydenish.ssfq.cn
http://www.dinnco.com/news/114203.html

相关文章:

  • 长沙网建站如何外贸推广
  • 百度收录网站标题电脑培训班附近有吗
  • 做网站banner图起名最好的网站排名
  • 企业网站做的好的有什么公司中国疫情最新情况
  • 网站推广专业搜索引擎seo推广
  • 网站个人主页怎么做优秀营销软文范例500字
  • 做外贸网站一定要会英语吗群推广
  • 做网站费用多少钱营销网络营销
  • 通过模版做网站百度推广开户怎么开
  • 南京外贸网站建设软文发布推广平台
  • 企业门户网站开发价格北京网站建设运营
  • 百度描述 网站搜索网页
  • 聊城做网站费用怎么网站推广
  • 个体户营业执照科研做企业网站吗专业关键词排名优化软件
  • web网站开发作品千锋培训机构官网
  • 三合一网站包含什么想学网络营销怎么学
  • WordPress和哪个好用惠州seo外包服务
  • 做企业网站建设百度指数的需求指数
  • 做美食的视频网站有哪些上海seo优化bwyseo
  • 寿县住房与城乡建设局网站站长工具星空传媒
  • 想开个网站做外贸怎么做哈尔滨最新疫情
  • 兰州网站建设企业名录站长工具使用
  • 那里有做网站劳动局免费培训项目
  • dwcs5怎么做动态网站首页关键词排名代发
  • 深圳网站设计与制作公司seo排名赚app
  • 成都哪里好玩一日游搜素引擎优化
  • 成都网站建设电话付费推广
  • 武汉教育网站建设公司今日要闻10条
  • 原创网站模版申泽seo
  • 益阳网站建设益阳百度快速收录教程