1、简单粗暴,直接在类中创建连接池使用

  1. package com.xiaostudy;
  2.  
  3. import org.apache.commons.dbcp.BasicDataSource;
  4. import org.springframework.jdbc.core.JdbcTemplate;
  5.  
  6. /**
  7. * @desc 测试类
  8. *
  9. * @author xiaostudy
  10. *
  11. */
  12. public class Test {
  13.  
  14. public static void main(String[] args) {
  15. //创建连接池
  16. BasicDataSource dataSource = new BasicDataSource();
  17. dataSource.setDriverClassName("com.mysql.jdbc.Driver");
  18. dataSource.setUrl("jdbc:mysql://localhost:3306/user");
  19. dataSource.setUsername("root");
  20. dataSource.setPassword("123456");
  21. //创建模板
  22. /*JdbcTemplate jdbcTemplate = new JdbcTemplate();
  23. jdbcTemplate.setDataSource(dataSource);*/
  24. JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
  25.  
  26. //添加
  27. jdbcTemplate.update("insert into spring_user(name, password) values(?, ?);", "xiaostudy", "123456");
  28. //修改
  29. jdbcTemplate.update("update spring_user set name=?,password=? where id=?;", "xiaostudy", "123456", "2");
  30. //删除
  31. jdbcTemplate.update("delete from spring_user where name=? and password=?;", "xiaostudy", "123456");
  32.  
  33. }
  34.  
  35. }

2、较第一种,就是把业务分开

2.1、domain类User.java

  1. package com.xiaostudy;
  2.  
  3. /**
  4. * @desc domain类
  5. * @author xiaostudy
  6. *
  7. */
  8. public class User {
  9.  
  10. private Integer id;
  11. private String name;
  12. private String password;
  13.  
  14. public Integer getId() {
  15. return id;
  16. }
  17.  
  18. public void setId(Integer id) {
  19. this.id = id;
  20. }
  21.  
  22. public String getName() {
  23. return name;
  24. }
  25.  
  26. public void setName(String name) {
  27. this.name = name;
  28. }
  29.  
  30. public String getPassword() {
  31. return password;
  32. }
  33.  
  34. public void setPassword(String password) {
  35. this.password = password;
  36. }
  37.  
  38. @Override
  39. public String toString() {
  40. return "User [id=" + id + ", name=" + name + ", password=" + password + "]";
  41. }
  42.  
  43. }

2.2、dao类UserDao.java

  1. package com.xiaostudy;
  2.  
  3. import org.apache.commons.dbcp.BasicDataSource;
  4. import org.springframework.jdbc.core.JdbcTemplate;
  5.  
  6. /**
  7. * @desc Dao类
  8. * @author xiaostudy
  9. *
  10. */
  11. public class UserDao {
  12.  
  13. /**
  14. * @desc 获取模板的方法
  15. * @return JdbcTemplate 返回类型
  16. */
  17. public JdbcTemplate getJdbcTemplate() {
  18. // 创建连接池
  19. BasicDataSource dataSource = new BasicDataSource();
  20. dataSource.setDriverClassName("com.mysql.jdbc.Driver");
  21. dataSource.setUrl("jdbc:mysql://localhost:3306/user");
  22. dataSource.setUsername("root");
  23. dataSource.setPassword("123456");
  24.  
  25. // 创建模板
  26. JdbcTemplate jdbcTemplate = new JdbcTemplate();
  27. jdbcTemplate.setDataSource(dataSource);
  28. return jdbcTemplate;
  29. }
  30.  
  31. /**
  32. * @desc 添加用户
  33. * @param user 参数
  34. * @return int 返回类型
  35. */
  36. public int insertUser(User user) {
  37. JdbcTemplate jdbcTemplate = getJdbcTemplate();
  38. return jdbcTemplate.update("insert into spring_user(name, password) values(?, ?);", user.getName(),
  39. user.getPassword());
  40. }
  41.  
  42. /**
  43. * @desc 修改用户
  44. * @param user 参数
  45. * @param id 参数
  46. * @return int 返回类型
  47. */
  48. public int updateUser(User user, int id) {
  49. JdbcTemplate jdbcTemplate = getJdbcTemplate();
  50. return jdbcTemplate.update("update spring_user set name=?,password=? where id=?;", user.getName(),
  51. user.getPassword(), id);
  52. }
  53.  
  54. /**
  55. * @desc 删除用户
  56. * @param user 参数
  57. * @return int 返回类型
  58. */
  59. public int deleteUser(User user) {
  60. JdbcTemplate jdbcTemplate = getJdbcTemplate();
  61. return jdbcTemplate.update("delete from spring_user where name=? and password=?;", user.getName(),
  62. user.getPassword());
  63. }
  64. }

2.3、测试类Test.java

  1. package com.xiaostudy;
  2.  
  3. /**
  4. * @desc 测试类
  5. * @author xiaostudy
  6. *
  7. */
  8. public class Test {
  9.  
  10. public static void main(String[] args) {
  11. User user = new User();
  12. user.setName("xiaostudy");
  13. user.setPassword("123456");
  14. UserDao userDao = new UserDao();
  15. // userDao.insertUser(user);
  16. // userDao.updateUser(user, 1);
  17. userDao.deleteUser(user);
  18.  
  19. }
  20.  
  21. }

3、较第二种,接入spring中

3.1、domain类User.java

  1. package com.xiaostudy;
  2.  
  3. /**
  4. * @desc damain类
  5. * @author xiaostudy
  6. *
  7. */
  8. public class User {
  9.  
  10. private Integer id;
  11. private String name;
  12. private String password;
  13.  
  14. public Integer getId() {
  15. return id;
  16. }
  17.  
  18. public void setId(Integer id) {
  19. this.id = id;
  20. }
  21.  
  22. public String getName() {
  23. return name;
  24. }
  25.  
  26. public void setName(String name) {
  27. this.name = name;
  28. }
  29.  
  30. public String getPassword() {
  31. return password;
  32. }
  33.  
  34. public void setPassword(String password) {
  35. this.password = password;
  36. }
  37.  
  38. @Override
  39. public String toString() {
  40. return "User [id=" + id + ", name=" + name + ", password=" + password + "]";
  41. }
  42.  
  43. }

3.2、dao类UserDao.java

  1. package com.xiaostudy;
  2.  
  3. import org.springframework.context.ApplicationContext;
  4. import org.springframework.context.support.ClassPathXmlApplicationContext;
  5. import org.springframework.jdbc.core.JdbcTemplate;
  6.  
  7. /**
  8. * @desc dao类
  9. * @author xiaostudy
  10. *
  11. */
  12. public class UserDao {
  13.  
  14. /**
  15. * @desc 获取模板的方法
  16. * @return JdbcTemplate 返回类型
  17. */
  18. public JdbcTemplate getJdbcTemplate() {
  19. //从spring容器中获取连接池对象
  20. ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
  21. return applicationContext.getBean("jdbcTemplate", JdbcTemplate.class);
  22. }
  23.  
  24. /**
  25. * @desc 添加用户
  26. * @param user 参数
  27. * @return int 返回类型
  28. */
  29. public int insertUser(User user) {
  30. JdbcTemplate jdbcTemplate = getJdbcTemplate();
  31. return jdbcTemplate.update("insert into spring_user(name, password) values(?, ?);", user.getName(), user.getPassword());
  32. }
  33.  
  34. /**
  35. * @desc 修改用户
  36. * @param user 参数
  37. * @param id 参数
  38. * @return int 返回类型
  39. */
  40. public int updateUser(User user, int id) {
  41. JdbcTemplate jdbcTemplate = getJdbcTemplate();
  42. return jdbcTemplate.update("update spring_user set name=?,password=? where id=?;", user.getName(), user.getPassword(), id);
  43. }
  44.  
  45. /**
  46. * @desc 删除用户
  47. * @param user 参数
  48. * @return int 返回类型
  49. */
  50. public int deleteUser(User user) {
  51. JdbcTemplate jdbcTemplate = getJdbcTemplate();
  52. return jdbcTemplate.update("delete from spring_user where name=? and password=?;", user.getName(), user.getPassword());
  53. }
  54. }

3.3、spring配置文件applicationContext.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:aop="http://www.springframework.org/schema/aop"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans
  7. http://www.springframework.org/schema/beans/spring-beans.xsd
  8. http://www.springframework.org/schema/aop
  9. http://www.springframework.org/schema/aop/spring-aop.xsd
  10. http://www.springframework.org/schema/context
  11. http://www.springframework.org/schema/context/spring-context.xsd">
  12. <!-- 将domain类添加到容器中 -->
  13. <bean id="user" class="com.xiaostudy.User"></bean>
  14. <!-- 将dao类添加到容器中 -->
  15. <bean id="userDao" class="com.xiaostudy.UserDao"></bean>
  16. <!-- 将连接池添加到容器中 -->
  17. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
  18. <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
  19. <property name="url" value="jdbc:mysql://localhost:3306/user"></property>
  20. <property name="username" value="root"></property>
  21. <property name="password" value="123456"></property>
  22. </bean>
  23. <!-- 将模板添加到容器中 -->
  24. <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
  25. <property name="dataSource" ref="dataSource"></property>
  26. </bean>
  27. </beans>

3.4、测试类Test.java

  1. package com.xiaostudy;
  2.  
  3. import org.springframework.context.ApplicationContext;
  4. import org.springframework.context.support.ClassPathXmlApplicationContext;
  5.  
  6. /**
  7. * @desc 测试类
  8. * @author xiaostudy
  9. *
  10. */
  11. public class Test {
  12.  
  13. public static void main(String[] args) {
  14. //获取spring容器
  15. ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
  16. //从容器中获取domain对象
  17. User user = applicationContext.getBean("user", User.class);
  18. user.setName("huangwu");
  19. user.setPassword("123456");
  20. //从容器中获取dao对象
  21. UserDao userDao = applicationContext.getBean("userDao", UserDao.class);
  22. //userDao.insertUser(user);
  23. userDao.updateUser(user, 2);
  24. //userDao.deleteUser(user);
  25.  
  26. }
  27.  
  28. }

4、较第三种,把在spring配置文件中的连接池信息提取到一个配置文件中

4.1、domain类User.java

  1. package com.xiaostudy;
  2.  
  3. /**
  4. * @domain类
  5. * @author xiaostudy
  6. *
  7. */
  8. public class User {
  9.  
  10. private Integer id;
  11. private String name;
  12. private String password;
  13.  
  14. public Integer getId() {
  15. return id;
  16. }
  17.  
  18. public void setId(Integer id) {
  19. this.id = id;
  20. }
  21.  
  22. public String getName() {
  23. return name;
  24. }
  25.  
  26. public void setName(String name) {
  27. this.name = name;
  28. }
  29.  
  30. public String getPassword() {
  31. return password;
  32. }
  33.  
  34. public void setPassword(String password) {
  35. this.password = password;
  36. }
  37.  
  38. @Override
  39. public String toString() {
  40. return "User [id=" + id + ", name=" + name + ", password=" + password + "]";
  41. }
  42.  
  43. }

4.2、dao类UserDao.java

  1. package com.xiaostudy;
  2.  
  3. import org.springframework.context.ApplicationContext;
  4. import org.springframework.context.support.ClassPathXmlApplicationContext;
  5. import org.springframework.jdbc.core.JdbcTemplate;
  6.  
  7. /**
  8. * @desc dao类
  9. * @author xiaostudy
  10. *
  11. */
  12. public class UserDao {
  13.  
  14. /**
  15. * @desc 获取模板的方法
  16. * @return JdbcTemplate 返回类型
  17. */
  18. public JdbcTemplate getJdbcTemplate() {
  19. ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
  20. return applicationContext.getBean("jdbcTemplate", JdbcTemplate.class);
  21. }
  22.  
  23. /**
  24. * @desc 添加用户
  25. * @param user 参数
  26. * @return int 返回类型
  27. */
  28. public int insertUser(User user) {
  29. JdbcTemplate jdbcTemplate = getJdbcTemplate();
  30. return jdbcTemplate.update("insert into spring_user(name, password) values(?, ?);", user.getName(), user.getPassword());
  31. }
  32.  
  33. /**
  34. * @desc 修改用户
  35. * @param user 参数
  36. * @param id 参数
  37. * @return int 返回类型
  38. */
  39. public int updateUser(User user, int id) {
  40. JdbcTemplate jdbcTemplate = getJdbcTemplate();
  41. return jdbcTemplate.update("update spring_user set name=?,password=? where id=?;", user.getName(), user.getPassword(), id);
  42. }
  43.  
  44. /**
  45. * @desc 删除用户
  46. * @param user 参数
  47. * @return int 返回类型
  48. */
  49. public int deleteUser(User user) {
  50. JdbcTemplate jdbcTemplate = getJdbcTemplate();
  51. return jdbcTemplate.update("delete from spring_user where name=? and password=?;", user.getName(), user.getPassword());
  52. }
  53. }

4.3、连接池的配置文件dataSource.properties

  1. jdbc.driverClassName=com.mysql.jdbc.Driver
  2. jdbc.url=jdbc:mysql://localhost:3306/user
  3. jdbc.username=root
  4. jdbc.password=123456

4.4、spring配置文件applicationContext.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:aop="http://www.springframework.org/schema/aop"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans
  7. http://www.springframework.org/schema/beans/spring-beans.xsd
  8. http://www.springframework.org/schema/aop
  9. http://www.springframework.org/schema/aop/spring-aop.xsd
  10. http://www.springframework.org/schema/context
  11. http://www.springframework.org/schema/context/spring-context.xsd">
  12. <!-- 将domain类添加到容器中 -->
  13. <bean id="user" class="com.xiaostudy.User"></bean>
  14. <!-- 将dao类添加到容器中 -->
  15. <bean id="userDao" class="com.xiaostudy.UserDao"></bean>
  16. <!-- 将连接池的配置文件添加到容器中 -->
  17. <context:property-placeholder location="classpath:dataSource.properties"/>
  18. <!-- 将连接池添加到容器中 -->
  19. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
  20. <property name="driverClassName" value="${jdbc.driverClassName}"></property>
  21. <property name="url" value="${jdbc.url}"></property>
  22. <property name="username" value="${jdbc.username}"></property>
  23. <property name="password" value="${jdbc.password}"></property>
  24. </bean>
  25. <!-- 将模板添加到容器中 -->
  26. <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
  27. <property name="dataSource" ref="dataSource"></property>
  28. </bean>
  29. </beans>

4.5、测试类Test.java

  1. package com.xiaostudy;
  2.  
  3. import org.springframework.context.ApplicationContext;
  4. import org.springframework.context.support.ClassPathXmlApplicationContext;
  5.  
  6. /**
  7. * @desc 测试类
  8. *
  9. * @author xiaostudy
  10. *
  11. */
  12. public class Test {
  13.  
  14. public static void main(String[] args) {
  15. //获取spring容器
  16. ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
  17. //从容器中获取domain对象
  18. User user = applicationContext.getBean("user", User.class);
  19. user.setName("lisi");
  20. user.setPassword("123456");
  21. //从容器中获取dao对象
  22. UserDao userDao = applicationContext.getBean("userDao", UserDao.class);
  23. //userDao.insertUser(user);
  24. userDao.updateUser(user, 2);
  25. //userDao.deleteUser(user);
  26.  
  27. }
  28.  
  29. }

5、较DBCP,用C3P0连接池,需要改变的就是连接池的包要改变,和连接池配置的名称要改


6、较第五种,把模板添加到容器改成让dao去添加模板

6.1、domain类User.java

  1. package com.xiaostudy;
  2.  
  3. /**
  4. * @desc domain类
  5. * @author xiaostudy
  6. *
  7. */
  8. public class User {
  9.  
  10. private Integer id;
  11. private String name;
  12. private String password;
  13.  
  14. public Integer getId() {
  15. return id;
  16. }
  17.  
  18. public void setId(Integer id) {
  19. this.id = id;
  20. }
  21.  
  22. public String getName() {
  23. return name;
  24. }
  25.  
  26. public void setName(String name) {
  27. this.name = name;
  28. }
  29.  
  30. public String getPassword() {
  31. return password;
  32. }
  33.  
  34. public void setPassword(String password) {
  35. this.password = password;
  36. }
  37.  
  38. @Override
  39. public String toString() {
  40. return "User [id=" + id + ", name=" + name + ", password=" + password + "]";
  41. }
  42.  
  43. }

6.2、dao类UserDao.java

  1. package com.xiaostudy;
  2.  
  3. import org.springframework.jdbc.core.JdbcTemplate;
  4. import org.springframework.jdbc.core.support.JdbcDaoSupport;
  5.  
  6. /**
  7. * @desc dao类
  8. * @author xiaostudy
  9. *
  10. */
  11. public class UserDao extends JdbcDaoSupport {
  12.  
  13. /**
  14. * @desc 添加用户
  15. * @param user 参数
  16. * @return int 返回类型
  17. */
  18. public int insertUser(User user) {
  19. //从继承的父类中获取模板
  20. JdbcTemplate jdbcTemplate = getJdbcTemplate();
  21. return jdbcTemplate.update("insert into spring_user(name, password) values(?, ?);", user.getName(), user.getPassword());
  22. }
  23.  
  24. /**
  25. * @desc 修改用户
  26. * @param user 参数
  27. * @param id 参数
  28. * @return int 返回类型
  29. */
  30. public int updateUser(User user, int id) {
  31. JdbcTemplate jdbcTemplate = getJdbcTemplate();
  32. return jdbcTemplate.update("update spring_user set name=?,password=? where id=?;", user.getName(), user.getPassword(), id);
  33. }
  34.  
  35. /**
  36. * @desc 删除用户
  37. * @param user 参数
  38. * @return int 返回类型
  39. */
  40. public int deleteUser(User user) {
  41. JdbcTemplate jdbcTemplate = getJdbcTemplate();
  42. return jdbcTemplate.update("delete from spring_user where name=? and password=?;", user.getName(), user.getPassword());
  43. }
  44. }

6.3、连接池的配置文件dataSource.properties

  1. jdbc.driverClassName=com.mysql.jdbc.Driver
  2. jdbc.url=jdbc:mysql://localhost:3306/user
  3. jdbc.username=root
  4. jdbc.password=123456

6.4、spring配置文件applicationContext.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:aop="http://www.springframework.org/schema/aop"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans
  7. http://www.springframework.org/schema/beans/spring-beans.xsd
  8. http://www.springframework.org/schema/aop
  9. http://www.springframework.org/schema/aop/spring-aop.xsd
  10. http://www.springframework.org/schema/context
  11. http://www.springframework.org/schema/context/spring-context.xsd">
  12. <!-- 将domain类添加到容器中 -->
  13. <bean id="user" class="com.xiaostudy.User"></bean>
  14. <!-- 将dao类添加到容器中 -->
  15. <bean id="userDao" class="com.xiaostudy.UserDao">
  16. <!-- 将连接池给dao,让dao去注入 -->
  17. <property name="dataSource" ref="dataSource"></property>
  18. </bean>
  19. <!-- 将连接池的配置文件添加到容器中 -->
  20. <context:property-placeholder location="classpath:dataSource.properties"/>
  21. <!-- 将连接池添加到容器中 -->
  22. <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
  23. <property name="driverClass" value="${jdbc.driverClass}"></property>
  24. <property name="jdbcUrl" value="${jdbc.jdbcUrl}"></property>
  25. <property name="user" value="${jdbc.user}"></property>
  26. <property name="password" value="${jdbc.password}"></property>
  27. </bean>
  28. </beans>

6.5测试类Test.java

  1. package com.xiaostudy;
  2.  
  3. import org.springframework.context.ApplicationContext;
  4. import org.springframework.context.support.ClassPathXmlApplicationContext;
  5.  
  6. /**
  7. * @desc 测试类
  8. * @author xiaostudy
  9. *
  10. */
  11. public class Test {
  12.  
  13. public static void main(String[] args) {
  14. //获取spring容器
  15. ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
  16. //从容器中获取domain对象
  17. User user = applicationContext.getBean("user", User.class);
  18. user.setName("sssss");
  19. user.setPassword("123456");
  20. //从容器中获取dao对象
  21. UserDao userDao = applicationContext.getBean("userDao", UserDao.class);
  22. //userDao.insertUser(user);
  23. userDao.updateUser(user, 2);
  24. //userDao.deleteUser(user);
  25.  
  26. }
  27.  
  28. }

springJDBC的几种方法的更多相关文章

  1. Spring使用jdbcJdbcTemplate和三种方法配置数据源

    三种方法配置数据源 1.需要引入jar包:spring-jdbc-4.3.2.RELEASE.jar <!-- spring内置,springJdbc,配置数据源 --> <bean ...

  2. JS 判断数据类型的三种方法

    说到数据类型,我们先理一下JavaScript中常见的几种数据类型: 基本类型:string,number,boolean 特殊类型:undefined,null 引用类型:Object,Functi ...

  3. DataTable 转换成 Json的3种方法

    在web开发中,我们可能会有这样的需求,为了便于前台的JS的处理,我们需要将查询出的数据源格式比如:List<T>.DataTable转换为Json格式.特别在使用Extjs框架的时候,A ...

  4. Android之数据存储的五种方法

    1.Android数据存储的五种方法 (1)SharedPreferences数据存储 详情介绍:http://www.cnblogs.com/zhangmiao14/p/6201900.html 优 ...

  5. 两个变量交换的四种方法(Java)

    对于两种变量的交换,我发现四种方法,下面我用Java来演示一下. 1.利用第三个变量交换数值,简单的方法. (代码演示一下) class TestEV //创建一个类 { public static ...

  6. C#中实现并发的几种方法的性能测试

    C#中实现并发的几种方法的性能测试 0x00 起因 去年写的一个程序因为需要在局域网发送消息支持一些命令和简单数据的传输,所以写了一个C/S的通信模块.当时的做法很简单,服务端等待链接,有用户接入后开 ...

  7. Atitti 载入类的几种方法    Class.forName ClassLoader.loadClass  直接new

    Atitti 载入类的几种方法    Class.forName ClassLoader.loadClass  直接new 1.1. 载入类的几种方法    Class.forName ClassLo ...

  8. windows下获取IP地址的两种方法

    windows下获取IP地址的两种方法: 一种可以获取IPv4和IPv6,但是需要WSAStartup: 一种只能取到IPv4,但是不需要WSAStartup: 如下: 方法一:(可以获取IPv4和I ...

  9. Python下载网页的几种方法

    get和post方式总结 get方式:以URL字串本身传递数据参数,在服务器端可以从'QUERY_STRING'这个变量中直接读取,效率较高,但缺乏安全性,也无法来处理复杂的数据(只能是字符串,比如在 ...

随机推荐

  1. sql优化(2)

    转自:https://www.cnblogs.com/Jacck/p/8030455.html 看到一篇非常全面的SQL优化文章,在开发的工作中往往不考虑性能上的缺失(在一开始的时候数据量不大也看不出 ...

  2. 爬虫入门【10】Pyspider框架简介及安装说明

    Pyspider是python中的一个很流行的爬虫框架系统,它具有的特点如下: 1.可以在Python环境下写脚本 2.具有WebUI,脚本编辑器,并且有项目管理和任务监视器以及结果查看. 3.支持多 ...

  3. C++名人的网站 转

    正如我们可以通过计算机历史上的重要人物了解计算机史的发展,C++相关人物的网站也可以使我们得到最有价值的参考与借鉴. 正如我们可以通过计算机历史上的重要人物了解计算机史的发展,C++相关人物的网站也可 ...

  4. MQ中间件对比

  5. springMvc获取特殊值

    1.获取数组

  6. 什么是EJB

    学习EJB可以加深对J2EE平台的认识. 百科定义EJB: 被称为java企业bean,服务器端组件,核心应用是部署分布式应用程序.用它部署的系统不限定平台.实际上ejb是一种产品,描述了应用组件要解 ...

  7. JS操作时间 - UNIX时间戳简单介绍

    准备知识 GMT(Greenwich Mean Time) - 格林尼治时间.UTC(Universal Time Code) - 国际协调时间.PST(Pacific Standard Time,太 ...

  8. python全栈开发从入门到放弃之网络基础

    一.操作系统基础 操作系统:(Operating System,简称OS)是管理和控制计算机硬件与软件资源的计算机程序,是直接运行在“裸机”上的最基本的系统软件,任何其他软件都必须在操作系统的支持下才 ...

  9. zend studio设置utf8

    1. windows -> preference -> general -> workspace 2.项目右键 -> properities -> resource 3. ...

  10. webservice -- cxf客户端调用axis2服务端

    背景: 有个项目, 需要由第三方提供用户信息, 实现用户同步操作, 对方给提供webservice接口(axis2实现)并也使用axis2作主客户端调用我方提供的webservice接口 起初, 由于 ...