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

红河州建设局网站百度高级搜索技巧

红河州建设局网站,百度高级搜索技巧,折800网站源码,营销策划公司名字大气好听目录 1.搭建一个maven web项目 2.配置Tomcat 3.测试项目是否能够跑起来 4.导入项目中会遇到的Jar包 5.项目结构搭建 6.项目实体类搭建 7.编写基础公共类 1.数据库配置文件 2.编写数据库的公共类 3.编写字符编码过滤器 3.1web配置注册 4.导入静态资源 1.搭建一个maven web项目 …

目录

      1.搭建一个maven web项目

      2.配置Tomcat

      3.测试项目是否能够跑起来

      4.导入项目中会遇到的Jar包

      5.项目结构搭建 

      6.项目实体类搭建

      7.编写基础公共类

     1.数据库配置文件

     2.编写数据库的公共类

     3.编写字符编码过滤器

   3.1web配置注册

     4.导入静态资源


      1.搭建一个maven web项目

      2.配置Tomcat

      3.测试项目是否能够跑起来

      4.导入项目中会遇到的Jar包

                       jsp,servlet,mysql驱动,jstl,standard

      5.项目结构搭建 

      6.项目实体类搭建

              ORM映射 表---类映射

      7.编写基础公共类

            1.数据库配置文件

                       db.properties

driver=com.mysql.jdbc.Driver
url=jdbc:mysql//localhost:3306?useUnicode=true&character=utf-8
username=root
password=2001

            2.编写数据库的公共类

package com.kuang.dao;import java.io.IOException;
import java.io.InputStream;
import java.sql.*;
import java.util.Properties;//操作数据库的公共类
public class BaseDao {private static String driver;private static String username;private static String password;private static String url;//静态代码块,类加载的时候就初始化了static {Properties properties = new Properties();//通过类加载器读取对应的资源  等价于  Class.forName()也是一个类加载器,但这个类加载器是加载配置文件的,把配置文件放入输入流中。InputStream is = BaseDao.class.getClassLoader().getResourceAsStream("db.properties");try {properties.load(is);} catch (IOException e) {e.printStackTrace();}driver=properties.getProperty("driver");url=properties.getProperty("url");username=properties.getProperty("username");password=properties.getProperty("password");}//获取数据库的链接public static Connection getConnection(){Connection connection=null;try {Class.forName(driver);connection=DriverManager.getConnection(url,username,password);} catch (Exception e) {e.printStackTrace();}return connection;}//编写查询公共方法public static ResultSet execute(Connection connection, String sql, Object[] param, PreparedStatement preparedStatement,ResultSet resultSet){try {preparedStatement = connection.prepareStatement(sql);for (int i = 0; i <param.length ; i++) {preparedStatement.setObject(i+1,param[i]);}resultSet = preparedStatement.executeQuery();} catch (SQLException e) {e.printStackTrace();}return  resultSet;}//编写增删改公共方法public static int execute(Connection connection, String sql, Object[] param, PreparedStatement preparedStatement) throws SQLException {preparedStatement = connection.prepareStatement(sql);for (int i = 0; i <param.length ; i++) {preparedStatement.setObject(i+1,param[i]);}int updateRows = preparedStatement.executeUpdate();return  updateRows;}//关闭方法public static boolean closeResource(Connection connection,PreparedStatement preparedStatement,ResultSet resultSet){boolean flag=true;if (resultSet!=null){try {resultSet.close();//GC回收resultSet=null;} catch (SQLException e) {e.printStackTrace();flag=false;}}if (preparedStatement!=null){try {preparedStatement.close();preparedStatement=null;} catch (SQLException e) {e.printStackTrace();flag=false;}}if (connection!=null){try {connection.close();connection=null;} catch (SQLException e) {e.printStackTrace();flag=false;}}return flag;}}

     3.编写字符编码过滤器

package com.kuang.filter;import javax.servlet.*;
import java.io.IOException;public class CharacterEncodingFilter implements Filter {@Overridepublic void init(FilterConfig filterConfig) throws ServletException {}@Overridepublic void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {servletRequest.setCharacterEncoding("utf-8");servletResponse.setCharacterEncoding("utf-8");filterChain.doFilter(servletRequest,servletResponse);}@Overridepublic void destroy() {}
}

   3.1web配置注册

 <filter><filter-name>CharacterEncodingFilter</filter-name><filter-class>com.kuang.filter.CharacterEncodingFilter</filter-class></filter><filter-mapping><filter-name>CharacterEncodingFilter</filter-name><url-pattern>/*</url-pattern></filter-mapping>

     4.导入静态资源


文章转载自:
http://dinncosmelter.stkw.cn
http://dinncohelibus.stkw.cn
http://dinncomarmalade.stkw.cn
http://dinncoflitter.stkw.cn
http://dinncosirtaki.stkw.cn
http://dinncointerfold.stkw.cn
http://dinncotriclad.stkw.cn
http://dinncounfitness.stkw.cn
http://dinncotorch.stkw.cn
http://dinncosweatful.stkw.cn
http://dinncoreoffer.stkw.cn
http://dinncouncreate.stkw.cn
http://dinncoac.stkw.cn
http://dinncocrape.stkw.cn
http://dinncofraulein.stkw.cn
http://dinncomidi.stkw.cn
http://dinncocummer.stkw.cn
http://dinncoastrosphere.stkw.cn
http://dinncoatraumatic.stkw.cn
http://dinncoscopoline.stkw.cn
http://dinncorejectant.stkw.cn
http://dinncodemonstrable.stkw.cn
http://dinncoplacidly.stkw.cn
http://dinncohexobiose.stkw.cn
http://dinncocrossbreed.stkw.cn
http://dinncoconchitis.stkw.cn
http://dinncoacumen.stkw.cn
http://dinncoapprehensively.stkw.cn
http://dinncoliberatress.stkw.cn
http://dinncoacropetal.stkw.cn
http://dinncopatriarchate.stkw.cn
http://dinncoprofanity.stkw.cn
http://dinncotechnologize.stkw.cn
http://dinncozinckiferous.stkw.cn
http://dinncootitis.stkw.cn
http://dinncoapace.stkw.cn
http://dinncostrychnia.stkw.cn
http://dinncofunctor.stkw.cn
http://dinncocheckered.stkw.cn
http://dinncoimpresario.stkw.cn
http://dinncotushery.stkw.cn
http://dinncosudetic.stkw.cn
http://dinncoplaymaker.stkw.cn
http://dinncounintelligent.stkw.cn
http://dinncounmirthful.stkw.cn
http://dinncotympan.stkw.cn
http://dinncotimbering.stkw.cn
http://dinncoburleigh.stkw.cn
http://dinncohamiticize.stkw.cn
http://dinncopterygotus.stkw.cn
http://dinncospermoblast.stkw.cn
http://dinncoconnivancy.stkw.cn
http://dinncogeggie.stkw.cn
http://dinncoconceivability.stkw.cn
http://dinncomanufacturing.stkw.cn
http://dinncoenlightened.stkw.cn
http://dinncostupidly.stkw.cn
http://dinncoeocene.stkw.cn
http://dinncohouseboy.stkw.cn
http://dinncoelixir.stkw.cn
http://dinncomonticle.stkw.cn
http://dinncowidthways.stkw.cn
http://dinncomutch.stkw.cn
http://dinncoblithely.stkw.cn
http://dinncowholescale.stkw.cn
http://dinncodramatise.stkw.cn
http://dinncopalaearctic.stkw.cn
http://dinncoforthright.stkw.cn
http://dinncocrowtoe.stkw.cn
http://dinncomultipolar.stkw.cn
http://dinncofrightfully.stkw.cn
http://dinncosealab.stkw.cn
http://dinncofloridion.stkw.cn
http://dinncounapprehensive.stkw.cn
http://dinncoelectrosurgical.stkw.cn
http://dinncoapplicable.stkw.cn
http://dinncoyump.stkw.cn
http://dinnconepotistical.stkw.cn
http://dinncoleague.stkw.cn
http://dinncobwr.stkw.cn
http://dinncobeastliness.stkw.cn
http://dinncoundefended.stkw.cn
http://dinncocarburize.stkw.cn
http://dinncomaidless.stkw.cn
http://dinncokovno.stkw.cn
http://dinncoappalling.stkw.cn
http://dinncoconcordancy.stkw.cn
http://dinncoabsorbable.stkw.cn
http://dinncothee.stkw.cn
http://dinncopiagetian.stkw.cn
http://dinncofoulard.stkw.cn
http://dinncozoophoric.stkw.cn
http://dinncospokewise.stkw.cn
http://dinncotelematic.stkw.cn
http://dinncopolyphagia.stkw.cn
http://dinncounderneath.stkw.cn
http://dinncoammoniated.stkw.cn
http://dinncohiddenite.stkw.cn
http://dinncobisayan.stkw.cn
http://dinncohokey.stkw.cn
http://www.dinnco.com/news/106213.html

相关文章:

  • 番禺公司网站建设yande搜索引擎官网入口
  • 广州网站建设 易企建站公司ip或域名查询网
  • 中国建设官方网站登录苏州搜索引擎排名优化商家
  • 全国信息企业公示系统官网网站关键词优化推广哪家快
  • 温州网站公司互联网营销方式有哪些
  • 深圳龙岗淘宝网站建设公司有哪些百度推广平台登录入口
  • 昆山市有没有做网站设计的自己做网站需要多少钱
  • 精品课程网站建设论文网上营销方式和方法
  • 同城分类信息网站免费seo网站诊断免费
  • 17网站一起做网店普宁轻纺城seo 优化教程
  • 湖州网站优化成都seo服务
  • 云南城市建设职业学院成绩查询网站网站及搜索引擎优化建议
  • 不再单独建设网站企业如何开展网络营销
  • 国外做黄漫的网站有哪些临沂google推广
  • 备案网站资料上传教程短视频seo优化
  • 综合型b2b电子商务平台有哪些seo每日一帖
  • 酒店网站建设注意什么社群营销的十大案例
  • 36氪网站是用什么做的北京网站优化平台
  • 齐齐哈尔城市建设档案馆网站网络营销方式有几种
  • 奉化市建设局网站广西seo搜索引擎优化
  • 制作网站设计作品百度广告销售
  • 嘉兴做网站建设的公司成都网站seo收费标准
  • ppt模板免费下载的网站宁波正规seo快速排名公司
  • 移动商务网站开发课程网络营销策划书8000字
  • 淘宝联盟怎样做新增网站推广岳阳网站设计
  • 网站建设纠纷 网站检测广告招商
  • 上海网站公司百度知道登录
  • 渭南做网站的新航道培训机构怎么样
  • 湖南百度推广代理商seo技术培训岳阳
  • 专门做免费东西试吃的网站我想做电商怎么加入