iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > Python >spring3+mbatis3开发实例
  • 258
分享到

spring3+mbatis3开发实例

实例 2023-01-31 06:01:43 258人浏览 独家记忆

Python 官方文档:入门教程 => 点击学习

摘要

最近一直在深入了解struts2,spring,hibernate以及mybatis框架,通过查看这些框架的源码和官方文档,发现自己对于这些框架的原理,使用有了更深的理解,那么今天我给大家带来的是运用spring和mybatis这两个框架来

最近一直在深入了解struts2,spring,hibernate以及mybatis框架,通过查看这些框架的源码和官方文档,发现自己对于这些框架的原理,使用有了更深的理解,那么今天

我给大家带来的是运用spring和mybatis这两个框架来开发的小例子,并给大家讲述一些开发中需要注意的一些细节。

1、新建一个WEB项目,修改web.xml文件,我的文件内容如下,大家把需要的拷走就行:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="Http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>dreamMall-dubbo-provider</display-name>
<!-- 加载spring文件监听器 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 加载log4j监听器 -->
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<!-- 解决spring容器运行时可能产生的内存溢出 -->
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<!-- spring文件路径 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring-*.xml</param-value>
</context-param>
<!-- log4j文件路径 -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.properties</param-value>
</context-param>
<!-- 开启watchdog线程监测配置文件的变化 -->
<context-param>
<param-name>log4jRefreshInterval</param-name>
<param-value>60000</param-value>
</context-param>
<!-- 设置编码格式 -->
<filter>
<filter-name>CharacterEncoding</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</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>CharacterEncoding</filter-name>
<url-pattern>
private static final long serialVersionUID = 1L;
private int id;
private String courceName;
private int teacherId;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getTeacherId() {
return teacherId;
}
public void setTeacherId(int teacherId) {
this.teacherId = teacherId;
}
public String getCourceName() {
return courceName;
}
public void setCourceName(String courceName) {
this.courceName = courceName;
}
@Override
public String toString() {
return "Cource [id=" + id + ", courceName=" + courceName + "]";
}
}

student.java:

package com.mall.dubbo.entity;
import java.io.Serializable;
public class Student implements Serializable {

private static final long serialVersionUID = 1L;
private int id;
private int age;
private String studentName;
private int sex;
private int teacherId;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getStudentName() {
return studentName;
}
public void setStudentName(String studentName) {
this.studentName = studentName;
}
public int getSex() {
return sex;
}
public void setSex(int sex) {
this.sex = sex;
}
public int getTeacherId() {
return teacherId;
}
public void setTeacherId(int teacherId) {
this.teacherId = teacherId;
}
@Override
public String toString() {
return "Student [id=" + id + ", age=" + age + ", studentName="
+ studentName + ", sex=" + sex + "]";
}
}

Teacher.java:

package com.mall.dubbo.entity;
import java.io.Serializable;
import java.util.List;
public class Teacher implements Serializable{

private static final long serialVersionUID = 1L;
private int id;
private String teacherName;
private int sex;
private int age;
private Cource cource;
private List<Student> students;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTeacherName() {
return teacherName;
}
public void setTeacherName(String teacherName) {
this.teacherName = teacherName;
}
public int getSex() {
return sex;
}
public void setSex(int sex) {
this.sex = sex;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Cource getCource() {
return cource;
}
public void setCource(Cource cource) {
this.cource = cource;
}
public List<Student> getStudents() {
return students;
}
public void setStudents(List<Student> students) {
this.students = students;
}
@Override
public String toString() {
return "Teacher [id=" + id + ", teacherName=" + teacherName + ", sex="
+ sex + ", age=" + age + "]";
}
}

4、建立映射关系,这部分是最重要的,这里面的知识点,我希望大家可以好好看,如果有什么问题的,可以评论留言,或者去查看mybatis3.2的官方文档

地址是 http://wenku.baidu.com/link?url=L6Lu0GufwrMCgBLGUbsfGy7Os6s7MEcKIsZQj7JhOxIo6BSbsULynqsWeqX0mIyIqkzLIozaQvnaAUROrWypUDQj3QBfe5j6jO3solfO3-G

cource.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.mall.dubbo.dao.CourceDao">
<resultMap type="com.mall.dubbo.entity.Cource" id="courceMap">
<id property="id" column="id" javaType="int" jdbcType="INTEGER"/>
<result property="courceName" column="cource_name" javaType="String" jdbcType="VARCHAR"/>
<result property="teacherId" column="teacher_id" javaType="int" jdbcType="INTEGER"/>
</resultMap>
<parameterMap type="com.mall.dubbo.entity.Cource" id="paraMap">
<parameter property="id"/>
<parameter property="courceName"/>
<parameter property="teacherId"/>
</parameterMap>
<sql id="courceSql">id,cource_name,teacher_id</sql>
<select id="selectAll" resultMap="courceMap">
select <include refid="courceSql"/> from cource
</select>
<select id="selectById" parameterType="int" resultMap="courceMap">
select <include refid="courceSql"/> from cource where
id=#{id,javaType=int,jdbcType=INTEGER}
</select>
<insert id="addCource" parameterMap="paraMap">
insert into cource (<include refid="courceSql"/>) values(
#{id,javaType=int,jdbcType=INTEGER},
#{courceName,javaType=String,jdbcType=VARCHAR},
#{teacherId,javaType=int,jdbcType=INTEGER}
)
</insert>
<update id="updateCourceById" parameterType="com.mall.dubbo.entity.Cource">
update cource set
cource_name=#{courceName,javaType=String,jdbcType=VARCHAR},
teacher_id=#{teacherId,javaType=int,jdbcType=INTEGER}
where id=#{id,javaType=int,jdbcType=INTEGER}
</update>
<delete id="deleteCourceById" parameterType="int">
delete from cource where id=#{id,javaType=int,jdbcType=INTEGER}
</delete>
<delete id="deleteAll">
delete from cource
</delete>
</mapper>


student.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.mall.dubbo.dao.StudentDao">
<resultMap type="com.mall.dubbo.entity.Student" id="studentMap">
<id property="id" column="id" javaType="int" jdbcType="INTEGER"/>
<result property="age" column="age" javaType="int" jdbcType="INTEGER"/>
<result property="studentName" column="student_name" javaType="String" jdbcType="VARCHAR"/>
<result property="sex" column="sex" javaType="int" jdbcType="INTEGER"/>
<result property="teacherId" column="teacher_id" javaType="int" jdbcType="INTEGER"/>
</resultMap>
<parameterMap type="com.mall.dubbo.entity.Student" id="parameMap">
<parameter property="id"/>
<parameter property="age"/>
<parameter property="studentName"/>
<parameter property="sex"/>
<parameter property="teacherId"/>
</parameterMap>
<sql id="studentSql">id,age,student_name,sex,teacher_id</sql>
<select id="selectAll" resultMap="studentMap">
select <include refid="studentSql"/> from student
</select>
<select id="selectById" parameterType="int" resultMap="studentMap">
select <include refid="studentSql"/> from student where id=#{id,javaType=int,jdbcType=INTEGER}
</select>
<insert id="addStudent" parameterType="com.mall.dubbo.entity.Student">
insert into student(<include refid="studentSql"/>) values (
#{id,javaType=int,jdbcType=INTEGER},
#{age,javaType=int,jdbcType=INTEGER},
#{studentName,javaType=String,jdbcType=VARCHAR},
#{sex,javaType=int,jdbcType=INTEGER},
#{teacherId,javaType=int,jdbcType=INTEGER}
)
</insert>
<update id="updateStudentById" parameterMap="parameMap">
update student set
age=#{age,javaType=int,jdbcType=INTEGER},
student_name=#{studentName,javaType=String,jdbcType=VARCHAR},
sex=#{sex,javaType=int,jdbcType=INTEGER},
teacher_id=#{teacherId,javaType=int,jdbcType=INTEGER}
where id=#{id,javaType=int,jdbcType=INTEGER}
</update>
<delete id="deleteStudentById" parameterType="int">
delete from student where id=#{id,javaType=int,jdbcType=INTEGER}
</delete>
<delete id="deleteAll">
delete from student
</delete>
</mapper>


teacher.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.mall.dubbo.dao.TeacherDao">
<resultMap type="com.mall.dubbo.entity.Teacher" id="TeacherMap">
<id property="id" column="id" javaType="int" jdbcType="INTEGER" />
<result property="teacherName" column="teacher_name" javaType="String"
jdbcType="VARCHAR" />
<result property="age" column="age" javaType="int" jdbcType="INTEGER" />
<result property="sex" column="sex" javaType="int" jdbcType="INTEGER" />
<!-- 方法一 -->
<!-- 使用这种方式,coulumn的名字不能重复,否则识别不了 -->
<association property="cource" javaType="com.mall.dubbo.entity.Cource">
<id property="id" column="cource_id" javaType="int" jdbcType="INTEGER" />
<result property="courceName" column="cource_name" javaType="String"
jdbcType="VARCHAR" />
<result property="teacherId" column="c_teacher_id" javaType="int"
jdbcType="INTEGER" />
</association>
<!-- 方法二 -->
<!-- <association property="cource" javaType="com.mall.dubbo.entity.Cource" 
resultMap="courceMap"/> -->
<!-- 方法三 -->
<association property="cource" javaType="com.mall.dubbo.entity.Cource" 
column="teacher_id" select="selectCourceById"/>
<!-- 方法一 -->
<!-- 使用这种方式,coulumn的名字不能重复,否则识别不了 -->
<collection property="students" ofType="com.mall.dubbo.entity.Student">
<id property="id" column="student_id" javaType="int" jdbcType="INTEGER" />
<result property="age" column="s_age" javaType="int" jdbcType="INTEGER" />
<result property="studentName" column="student_name" javaType="String"
jdbcType="VARCHAR" />
<result property="sex" column="s_sex" javaType="int" jdbcType="INTEGER" />
<result property="teacherId" column="s_teacher_id" javaType="int"
jdbcType="INTEGER" />
</collection>
<!-- 方法二 -->
<!-- <collection property="students" ofType="com.mall.dubbo.entity.Student" 
resultMap="studentMap"/> -->
<!-- 方法三 -->
<!-- <collection property="students" ofType="com.mall.dubbo.entity.Student" 
column="teacher_id" select="selectStudentByTeacherId"/> -->
</resultMap>
<!-- 对应于方法二 -->
<!-- <resultMap type="com.mall.dubbo.entity.Cource" id="courceMap"> <id 
property="id" column="cource_id" javaType="int" jdbcType="INTEGER"/> 
<result property="courceName" column="cource_name" javaType="String" jdbcType="VARCHAR"/> 
<result property="teacherId"  column="c_teacher_id" javaType="int" jdbcType="INTEGER"/> 
</resultMap> -->
<!-- 对应于方法二 -->
<!-- <resultMap type="com.mall.dubbo.entity.Student" id="studentMap"> <id 
property="id" column="student_id" javaType="int" jdbcType="INTEGER"/> 
<result property="age" column="s_age" javaType="int" jdbcType="INTEGER"/>
<result property="studentName" column="student_name" javaType="String" jdbcType="VARCHAR"/> 
<result property="sex" column="s_sex" javaType="int" jdbcType="INTEGER"/>
<result property="teacherId" column="s_teacher_id" javaType="int" jdbcType="INTEGER"/> 
</resultMap> -->
<parameterMap type="com.mall.dubbo.entity.Teacher" id="paraMap">
<parameter property="id" />
<parameter property="teacherName" />
<parameter property="age" />
<parameter property="sex" />
</parameterMap>
<sql id="teacherSql">id,teacher_name,age,sex</sql>
<!-- 对应于方法三 -->
<!-- <select id="selectCourceByTeacherId" parameterType="int" resultType="com.mall.dubbo.entity.Cource"> 
select * from cource where teacher_id=#{id,javaType=int,jdbcType=INTEGER} 
</select>
<select id="selectStudentByTeacherId" parameterType="int" resultType="com.mall.dubbo.entity.Student"> 
select * from student where teacher_id=#{id,javaType=int,jdbcType=INTEGER} 
</select> -->
<select id="selectTeacerById" parameterType="int" resultMap="TeacherMap">
select t.*,s.id student_id,s.age s_age,s.sex s_sex,s.teacher_id s_teacher_id,s.student_name,
c.id cource_id,c.cource_name,c.teacher_id c_teacher_id
from teacher t join cource c on t.id=c.teacher_id left outer join student
s on t.id=s.teacher_id
where t.id=#{id,javaType=int,jdbcType=INTEGER}
</select>
<!-- <select id="selectTeacerById" parameterType="int" resultMap="TeacherMap">
select * from teacher where id=#{id,javaType=int,jdbcType=INTEGER}
</select> -->
<select id="selectAll" resultMap="TeacherMap">
select t.*,s.id student_id,s.age s_age,s.sex s_sex,s.teacher_id s_teacher_id,s.student_name,
c.id cource_id,c.cource_name,c.teacher_id c_teacher_id
from teacher t join cource c on t.id=c.teacher_id left outer join student
s on t.id=s.teacher_id
</select>
<insert id="addTeacher" parameterMap="paraMap">
insert into teacher(
<include refid="teacherSql" />
)values(
#{id,javaType=int,jdbcType=INTEGER},
#{teacherName,javaType=String,jdbcType=VARCHAR},
#{age,javaType=int,jdbcType=INTEGER},
#{sex,javaType=int,jdbcType=INTEGER}
)
</insert>
</mapper>


以上就是三者的映射关系,在这里对于student.xml和cource.xml我不想过多的去说,大家注意resultMap,resultType,paramType,paramMap这四个属***的不同就行

我重点讲一下teacher.xml文件中的映射关系,这里面涉及到collection和association这两个元素,这两个元素分别代表者1对多和1对1的关系,需要注意的是,

查询的结果总不要有相同的字段名,如果存在相同的字段名会覆盖,从而导致查询的结果不对。


5、对应的Dao接口

GenericDao:

package com.mall.dubbo.dao;
public interface GenericDao {
}

该接口是所有的dao接口的父接口,对于与配置文件中的markerInterface


CourceDao:

package com.mall.dubbo.dao;
import org.springframework.stereotype.Repository;
import com.mall.dubbo.entity.Cource;
@Repository
public interface CourceDao extends GenericDao {
public abstract void addCource(Cource cource);
public abstract Cource selectById(int id);
public abstract void updateCourceById(Cource cource);
}


StudentDao:

package com.mall.dubbo.dao;
import com.mall.dubbo.entity.Student;
@Repository
public interface StudentDao extends GenericDao {
public abstract void addStudent(Student student);
}


TeacherDao:

package com.mall.dubbo.dao;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.mall.dubbo.entity.Teacher;
@Repository
public interface TeacherDao extends GenericDao{
public abstract void addTeacher(Teacher teacher);
public abstract Teacher selectTeacerById(int id);
public abstract List<Teacher> selectAll();
}


6、编写测试

CourceTest.java:

package com.mall.dubbo.test;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import com.mall.dubbo.dao.CourceDao;
import com.mall.dubbo.entity.Cource;
public class CourceTest {
private ApplicationContext context = new FileSystemXmlApplicationContext("classpath:spring-mybatis.xml");
@Test
public void addCource(){
Cource cource = new Cource();
cource.setCourceName("English");
cource.setId(2);
cource.setTeacherId(1);
CourceDao dao = context.getBean(CourceDao.class);
dao.addCource(cource);
}
//@Test
public void getCourceById(){
CourceDao dao = context.getBean(CourceDao.class);
Cource c = dao.selectById(1);
System.out.println(c);
}
//@Test
public void updateCourceById(){
Cource cource = new Cource();
cource.setCourceName("France");
cource.setId(1);
cource.setTeacherId(2);
CourceDao dao = context.getBean(CourceDao.class);
dao.updateCourceById(cource);
}
}


StudentTest.java:

package com.mall.dubbo.test;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import com.mall.dubbo.dao.StudentDao;
import com.mall.dubbo.entity.Student;
public class StudentTest {
ApplicationContext context = new FileSystemXmlApplicationContext("classpath:spring-mybatis.xml");
StudentDao dao = context.getBean(StudentDao.class);
@Test
public void addStudentTest(){
Student stu = new Student();
stu.setAge(21);
stu.setId(3);
stu.setSex(1);
stu.setStudentName("zhangqi");
stu.setTeacherId(1);
dao.addStudent(stu);
}
}


TeacherTest.java:

package com.mall.dubbo.test;
import java.util.List;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import com.mall.dubbo.dao.TeacherDao;
import com.mall.dubbo.entity.Cource;
import com.mall.dubbo.entity.Student;
import com.mall.dubbo.entity.Teacher;
public class TeacherTest {
ApplicationContext context = new FileSystemXmlApplicationContext("classpath:spring-mybatis.xml");
TeacherDao dao = context.getBean(TeacherDao.class);
//@Test
public void addTeacherTest(){
Teacher t = new Teacher();
t.setAge(45);
t.setId(1);
t.setSex(0);
t.setTeacherName("liusanming");
dao.addTeacher(t);
}
@Test
public void getTeacherById(){
Teacher t = dao.selectTeacerById(1);
Cource c = t.getCource();
List<Student> stus = t.getStudents();
System.out.println(stus+","+stus.size());
System.out.println(c);
System.out.println(t);
}
//@Test
public void getTeachers(){
List<Teacher> ts = dao.selectAll();
System.out.println(ts.size());
Teacher t = ts.get(0);
Cource c = t.getCource();
List<Student> stus = t.getStudents();
System.out.println(stus+","+stus.size());
System.out.println(c);
System.out.println(t);
}
}

到此整个的开发过程就结束了,内容有点多,希望能够对大家有帮助。大家如果有什么问题,请留言!

本人也毕业未满一年,如果讲的有什么不对的地方,请指正,我们一块进步,谢谢!


--结束END--

本文标题: spring3+mbatis3开发实例

本文链接: https://www.lsjlt.com/news/189637.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • spring3+mbatis3开发实例
    最近一直在深入了解struts2,spring,hibernate以及mybatis框架,通过查看这些框架的源码和官方文档,发现自己对于这些框架的原理,使用有了更深的理解,那么今天我给大家带来的是运用spring和mybatis这两个框架来...
    99+
    2023-01-31
    实例
  • k3cloud开发实例
    开发工具        Visual studio 2012        IE插件Silverlight5        SQLServer 2008R2 或 Oracle 11G R2        跟踪工具(HttpWatchPro6...
    99+
    2023-01-31
    实例 k3cloud
  • android studio开发app实例
    以下是一个简单的Android Studio开发App的实例: 打开Android Studio,并创建一个新项目。 选择一个适当的应用程序名称和包名称,然后选择目标API级别和默认Activity的模板。 在MainActivity...
    99+
    2023-09-05
    android studio android ide
  • Laravel开发实例分析
    本篇内容主要讲解“Laravel开发实例分析”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Laravel开发实例分析”吧!   准备开发环境   原教程使用...
    99+
    2024-04-02
  • AndroidService开发应用实例
    目录Service 开发应用BindServiceIntentServiceService 开发应用 在后台长时间运行,没有界面UI, 在后台下载文件和获取用户GPS信息 Servi...
    99+
    2022-12-16
    Android Service Android Service开发
  • H5、CSS3、Mui开发实例
    前言    因进度需要,所以本人从一个服务端、架构暂时变成了一个前端开发者!对于前端的理解    所谓“万变不离其宗”,就是这样一个道理,写惯了服务端,当接触前端以前总觉得很难,但是当我真正开始写的时候,发觉一如既往的简单,就是简单的jqu...
    99+
    2023-01-31
    实例 Mui
  • Epicor开发实例分析
    Epicor开发实例分析,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。关于Epicor开发实例分析问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很...
    99+
    2023-06-05
  • Node.js开发实例分析
    这篇文章主要讲解了“Node.js开发实例分析”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Node.js开发实例分析”吧!1.分层组织代码例如Express.js这个应用广泛的Node.j...
    99+
    2023-06-29
  • 用Eclipse开发Struts实例-G
    十、建立读取留言信息的Action类 1、建立GuestBook的JavaBean类 package com.meixin.beans; public class Guestbook {   private ...
    99+
    2023-01-31
    实例 Eclipse Struts
  • VB6.0数据库开发实例
    以下是一个使用VB6.0进行数据库开发的示例:首先,你需要创建一个新的VB6.0项目。接下来,你需要添加一个数据库。可以使用Micr...
    99+
    2023-09-20
    VB
  • FlutterWidget开发Shortcuts快捷键实例
    目录正文ShortcutActivators到Intents的映射想要捕获Control + C ?正文 Flutter所提供的键盘快捷键系统直接用就很棒了,而且还提供了大量的空间...
    99+
    2022-12-08
    Flutter Widget Shortcuts快捷键 Flutter Widget
  • Maven聚合开发实例详解
    目录一、Maven聚合开发_继承关系二、Maven聚合案例1. 搭建dao模块2. 搭建service模块  3. 搭建web模块 4. 运行项目一、M...
    99+
    2023-03-20
    Maven聚合开发 Maven聚合
  • Java NIO开发的实例介绍
    本篇内容介绍了“Java NIO开发的实例介绍”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!首先来看下传统的阻塞型网络I/O的不足Java ...
    99+
    2023-06-17
  • Vue3开发实例代码分析
    获取 thisVue2 中每个组件里使用 this 都指向当前组件实例,this 上还包含了全局挂载的东西,都知道 this.xxx 啥都有而 Vue3 中没有 this,如果想要类似的用法有两种,一是获取当前组件实例,二是获取全局实例,如...
    99+
    2023-05-17
    Vue3
  • python+django+mysql开发实例分析
    本篇内容主要讲解“python+django+mysql开发实例分析”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“python+django+mysql开发实例分析”吧!开发工具:pycharm...
    99+
    2023-06-26
  • Android开发文件存储实例
    Android的文件存储,有I/O流的方式存储,与java一样,还有一种Android自己的SharePreferences存储方法。 下面看一个例子: 用I/O流的方式存储方法和S...
    99+
    2024-04-02
  • 开发mysql单实例或多实例启动脚本
    单实例启动:mysqld_safe --user=mysql &停止:mysqladmin -u root -proot shutdown开发脚本#!/bin/bash #chkconfig:&nb...
    99+
    2024-04-02
  • ZooKeeper开发实际应用案例实战
    目录项目背景介绍面临问题如何解决代码讲解数据服务器检索服务器总结附:完整代码数据服务端代码检索服务端代码ZooKeeper入门教程一简介与核心概念 ZooKeeper入门教程二在单机...
    99+
    2024-04-02
  • C#MSN插件开发实例分析
    这篇文章主要介绍“C#MSN插件开发实例分析”,在日常操作中,相信很多人在C#MSN插件开发实例分析问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”C#MSN插件开发实例分析”的疑惑有所帮助!接下来,请跟着小编...
    99+
    2023-06-17
  • Node模块化开发实例解析
    目录一、介绍1. 什么是模块化开发2. Node.js中的模块化3. 模块化开发的优点二、CommonJS规范1. CommonJS规范介绍2. Node.js中的模块加载机制3. ...
    99+
    2023-03-13
    Node模块化开发 Node 模块化
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作