mybatis学习(54):鉴定器

数据库表

数据库叫blog_gp1701

author表

数据

blog表

数据

comment表

数据

post表

数据

vechcle

目录结构

jar包导入

先给对应的jar包导入

建立一个junit单元测试

配置文件

log4j.properties

### \u914D\u7F6E\u6839 ###
log4j.rootLogger = debug,console ,fileAppender,dailyRollingFile,ROLLING_FILE,MAIL,DATABASE### \u8BBE\u7F6E\u8F93\u51FAsql\u7684\u7EA7\u522B\uFF0C\u5176\u4E2Dlogger\u540E\u9762\u7684\u5185\u5BB9\u5168\u90E8\u4E3Ajar\u5305\u4E2D\u6240\u5305\u542B\u7684\u5305\u540D ###
log4j.logger.org.apache=dubug
log4j.logger.java.sql.Connection=dubug
log4j.logger.java.sql.Statement=dubug
log4j.logger.java.sql.PreparedStatement=dubug
log4j.logger.java.sql.ResultSet=dubug### \u914D\u7F6E\u8F93\u51FA\u5230\u63A7\u5236\u53F0 ###
log4j.appender.console = org.apache.log4j.ConsoleAppender
log4j.appender.console.Target = System.out
log4j.appender.console.layout = org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern =  %d{ABSOLUTE} %5p %c{1}:%L - %m%n

mybatis-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings><setting name="useGeneratedKeys" value="true"/>
</settings>
<typeAliases><!--  <typeAlias type="com.geyao.mybatis.pojo.Blog" alias="Blog"/><typeAlias type="com.geyao.mybatis.pojo.Author" alias="Author"/>--><package name="com.geyao.mybatis.pojo"/><package name="com.geyao.mybatis.mvo"/>
</typeAliases><environments default="development"><environment id="development"><transactionManager type="JDBC" /><!-- 配置数据库连接信息 --><dataSource type="POOLED"><property name="driver" value="com.mysql.cj.jdbc.Driver" /><property name="url" value="jdbc:mysql://localhost:3306/blog_gp1701?serverTimezone=GMT%2B8" /><property name="username" value="root" /><property name="password" value="123" /></dataSource></environment></environments><mappers><!-- 注册userMapper.xml文件, userMapper.xml位于me.gacl.mapping这个包下,所以resource写成me/gacl/mapping/userMapper.xml--><mapper resource="com/geyao/mybatis/mapper/BlogMapper.xml"/><mapper resource="com/geyao/mybatis/mapper/AuthorMapper.xml"/><mapper resource="com/geyao/mybatis/mapper/BlogMapperCustom.xml"/><mapper resource="com/geyao/mybatis/mapper/VehicleMapper.xml"/></mappers></configuration>

com.geyao.mybatis.mapper

AuthorMapper

package com.geyao.mybatis.mapper;import com.geyao.mybatis.pojo.Author;
public interface AuthorMapper {Author selectAuthorById(Integer id);
}

BlogMapper

package com.geyao.mybatis.mapper;import java.util.List;import com.geyao.mybatis.pojo.Blog;public interface BlogMapper {Blog selectBlogById(Integer id);List<Blog> selectBlogList();List<Blog> selectBlogListNested();Blog selectBlogByIdConstructor(Integer id);
}

Comment.Maoper

package com.geyao.mybatis.mapper;import java.util.List;import com.geyao.mybatis.pojo.Comment;public interface CommentMapper {
List<Comment> selectCommentByPostId(Integer id);
}

PostMapper

package com.geyao.mybatis.mapper;import com.geyao.mybatis.pojo.Post;public interface PostMapper {Post selectPostById(Integer id);
}

AuthorMapper.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,namespace的值习惯上设置成包名+sql映射文件名,这样就能够保证namespace的值是唯一的
例如namespace="me.gacl.mapping.userMapper"就是me.gacl.mapping(包名)+userMapper(userMapper.xml文件去除后缀)-->
<mapper namespace="com.geyao.mybatis.mapper.AuthorMapper"><resultMap type="Author" id="authorResultMap"><id column="id" property="id" jdbcType="INTEGER"></id></resultMap><select id="selectAuthorById" parameterType="int" resultMap="authorResultMap">select * from author where id=#{id}</select>
</mapper>

BlogMapper.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.geyao.mybatis.mapper.BlogMapper"><resultMap type="Blog" id="blogResultMap"><id column="id" property="id" jdbcType="INTEGER"></id>                                     <association property="author" column="author" javaType="Author"select="com.geyao.mybatis.mapper.AuthorMapper.selectAuthorById"></association></resultMap><select id="selectBlogById" parameterType="int" resultMap="blogResultMap">select * from Blog where id=#{id}</select><select id="selectBlogList"  resultMap="blogResultMap">select * from Blog </select><resultMap type="Blog" id="blogResultMapNested"><id column="blog_id" property="id"></id><result column="blog_title" property="title"></result><result column="blog_state" property="state"></result><result column="blog_featured" property="featured"></result><result column="blog_style" property="style"></result><association column="blog_atuthor" property="author" javaType="Author"><id column="author_id" property="id"></id><result column="author_username" property="username"></result><result column="author_password" property="password"></result><result column="author_email" property="email"></result><result column="author_bio" property="bio"></result><result column="blog_favouriteSection" property="favouriteSection"></result><result column="blog_nickname" property="nickname"></result><result column="blog_realname" property="realname"></result></association></resultMap><select id="selectBlogListNested" resultMap="blogResultMapNested">SELECTb.id AS blog_id,b.title AS blog_title,b.author AS blog_author,b.state AS blog_state,b.featured AS blog_featured,b.style AS blog_style,a.id AS author_id,a.username AS author_username,a.password AS author_password,a.email AS author_email,a.bio AS author_bio,a.favouriteSection AS author_favouriteSection,a.nickname AS author_nickname,a.realname AS author_realnameFROM blog bLEFT JOIN author aON b.author= a.id</select><resultMap type="Blog" id="blogResultMapConstructor"><constructor><idArg column="id" javaType="int"></idArg><arg column="title" javaType="string"></arg></constructor></resultMap><select id="selectBlogByIdConstructor" parameterType="int" resultMap="blogResultMapConstructor">select * from blog where id= #{id}</select>
</mapper>

CommentMapper.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,namespace的值习惯上设置成包名+sql映射文件名,这样就能够保证namespace的值是唯一的
例如namespace="me.gacl.mapping.userMapper"就是me.gacl.mapping(包名)+userMapper(userMapper.xml文件去除后缀)-->
<mapper namespace="com.geyao.mybatis.mapper.CommentMapper"><resultMap type="Comment" id="commentResultMap"><id column="id" property="id" jdbcType="INTEGER"></id></resultMap><select id="selectCommentByPostId" parameterType="int" resultMap="commentResultMap">select * from comment where post_id=#{postId}</select><select id="selectCommentById" parameterType="int" resultMap="commentResultMap">select * from comment where id=#{id}</select>
</mapper>

PostMapper.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,namespace的值习惯上设置成包名+sql映射文件名,这样就能够保证namespace的值是唯一的
例如namespace="me.gacl.mapping.userMapper"就是me.gacl.mapping(包名)+userMapper(userMapper.xml文件去除后缀)-->
<mapper namespace="com.geyao.mybatis.mapper.PostMapper"><resultMap type="Post" id="postResultMap"><id column="id" property="id" jdbcType="INTEGER"></id><collection property="commentList" column="id" javaType="ArrayList" ofType="Comment"select="com.geyao.mybatis.mapper.CommentMapper.selectCommentByPostId"></collection></resultMap><select id="selectPostById" parameterType="int" resultMap="postResultMap">select * from post where id=#{id}</select>
</mapper>

VehicleMapper.

package com.geyao.mybatis.mapper;import com.geyao.mybatis.pojo.Vehicle;public interface VehicleMapper {Vehicle selectVehicleById(Integer id);
}
package com.geyao.mybatis.mapper;import com.geyao.mybatis.pojo.Vehicle;public interface VehicleMapper {Vehicle selectVehicleById(Integer id);
}

VehicleMapper.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,namespace的值习惯上设置成包名+sql映射文件名,这样就能够保证namespace的值是唯一的
例如namespace="me.gacl.mapping.userMapper"就是me.gacl.mapping(包名)+userMapper(userMapper.xml文件去除后缀)-->
<mapper namespace="com.geyao.mybatis.mapper.VehicleMapper"><resultMap type="Vehicle" id="vehicleResultMap"><id column="id" property="id" jdbcType="INTEGER"></id><discriminator javaType="int" column="vehicle_type"><case value="1" resultType="Car"><result column="door_count" property="doorCount"></result></case><case value="2" resultType="Suv"><result column="all_wheel_drive" property="allWheelDrive"></result></case></discriminator></resultMap><select id="selectVehicleById" parameterType="int" resultMap="vehicleResultMap">select * from vehicle where id=#{id}</select>
</mapper>

com.geyao.mybatis.pojo

vehicle类

package com.geyao.mybatis.pojo;import java.util.Date;public abstract class Vehicle {private Integer id;private String vin;private Date year;private String make;private String model;private String color;public Vehicle() {}public Integer getId() {return id;}public void setId(Integer id) {this.id = id;}public String getVin() {return vin;}public void setVin(String vin) {this.vin = vin;}public Date getYear() {return year;}public void setYear(Date year) {this.year = year;}public String getMake() {return make;}public void setMake(String make) {this.make = make;}public String getModel() {return model;}public void setModel(String model) {this.model = model;}public String getColor() {return color;}public void setColor(String color) {this.color = color;}@Overridepublic String toString() {return "Vehicle [id=" + id + ", vin=" + vin + ", year=" + year + ", make=" + make + ", model=" + model+ ", color=" + color + "]";}}

Car类

package com.geyao.mybatis.pojo;public class Car extends Vehicle {private Integer doorCount;public Car() {}public Integer getDoorCount() {return doorCount;}public void setDoorCount(Integer doorCount) {this.doorCount = doorCount;}}

Suv

package com.geyao.mybatis.pojo;public class Suv extends Vehicle {private Boolean allWheelDrive;public Suv() {}public Boolean getAllWheelDrive() {return allWheelDrive;}public void setAllWheelDrive(Boolean allWheelDrive) {this.allWheelDrive = allWheelDrive;}@Overridepublic String toString() {return "Suv [allWheelDrive=" + allWheelDrive + "]";}}

Author

package com.geyao.mybatis.pojo;public class Author {private Integer id;private String username;private String password;private String email;private String bio;private String favouriteSection;private String nickname;private String realname;public Author() {super();}public Integer getId() {return id;}public void setId(Integer id) {this.id = id;}public String getUsername() {return username;}public void setUsername(String username) {this.username = username;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}public String getEmail() {return email;}public void setEmail(String email) {this.email = email;}public String getBio() {return bio;}public void setBio(String bio) {this.bio = bio;}public String getFavouriteSection() {return favouriteSection;}public void setFavouriteSection(String favouriteSection) {this.favouriteSection = favouriteSection;}public String getNickname() {return nickname;}public void setNickname(String nickname) {this.nickname = nickname;}public String getRealname() {return realname;}public void setRealname(String realname) {this.realname = realname;}public Author(Integer id, String username, String password, String email, String bio, String favouriteSection,String nickname, String realname) {super();this.id = id;this.username = username;this.password = password;this.email = email;this.bio = bio;this.favouriteSection = favouriteSection;this.nickname = nickname;this.realname = realname;}@Overridepublic String toString() {return "Author [id=" + id + ", username=" + username + ", password=" + password + ", email=" + email + ", bio="+ bio + ", favouriteSection=" + favouriteSection + ", nickname=" + nickname + ", realname=" + realname+ "]";}}

Blog

package com.geyao.mybatis.pojo;import java.io.Serializable;public class Blog implements Serializable {private static final long serialVersionUID = 1L;private Integer id;private String title;private Author author;private String state;private boolean featured;private String style;public Integer getId() {return id;}public void setId(Integer id) {this.id = id;}public String getTitle() {return title;}public void setTitle(String title) {this.title = title;}public Author getAuthor() {return author;}public void setAuthor(Author author) {this.author = author;}public String getState() {return state;}public void setState(String state) {this.state = state;}public boolean isFeatured() {return featured;}public void setFeatured(boolean featured) {this.featured = featured;}public String getStyle() {return style;}public void setStyle(String style) {this.style = style;}public static long getSerialversionuid() {return serialVersionUID;}@Overridepublic String toString() {return "Blog [id=" + id + ", title=" + title + ", author=" + author + ", state=" + state + ", featured="+ featured + ", style=" + style + "]\n";}public Blog(Integer id, String title) {super();this.id = id;this.title = title;System.out.println("构造方法执行中。。");}}

Comment

package com.geyao.mybatis.pojo;import java.util.Date;public class Comment {private Integer id;private String name;private String comment;private Date createOn;private Post post;private Author author;public Comment() {}public Comment(Integer id, String name, String comment, Date createOn, Post post, Author author) {super();this.id = id;this.name = name;this.comment = comment;this.createOn = createOn;this.post = post;this.author = author;}public Integer getId() {return id;}public void setId(Integer id) {this.id = id;}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getComment() {return comment;}public void setComment(String comment) {this.comment = comment;}public Date getCreateOn() {return createOn;}public void setCreateOn(Date createOn) {this.createOn = createOn;}public Post getPost() {return post;}public void setPost(Post post) {this.post = post;}public Author getAuthor() {return author;}public void setAuthor(Author author) {this.author = author;}@Overridepublic String toString() {return "Comment [id=" + id + ", name=" + name + ", comment=" + comment + ", createOn=" + createOn + ", post="+ post + ", author=" + author + "]";}}

Post

package com.geyao.mybatis.pojo;import java.util.Date;
import java.util.List;public class Post {private Integer id;private Author author;private Blog blog;private Date createOn;private String section;private String subject;private String draft;private String body;private Integer visit;private List<Comment> commentList;public Post(Integer id, Author author, Blog blog, Date createOn, String section, String subject, String draft,String body, Integer visit, List<Comment> commentList) {super();this.id = id;this.author = author;this.blog = blog;this.createOn = createOn;this.section = section;this.subject = subject;this.draft = draft;this.body = body;this.visit = visit;this.commentList = commentList;}public Post() {super();}public Integer getId() {return id;}public void setId(Integer id) {this.id = id;}public Author getAuthor() {return author;}public void setAuthor(Author author) {this.author = author;}public Blog getBlog() {return blog;}public void setBlog(Blog blog) {this.blog = blog;}public Date getCreateOn() {return createOn;}public void setCreateOn(Date createOn) {this.createOn = createOn;}public String getSection() {return section;}public void setSection(String section) {this.section = section;}public String getSubject() {return subject;}public void setSubject(String subject) {this.subject = subject;}public String getDraft() {return draft;}public void setDraft(String draft) {this.draft = draft;}public String getBody() {return body;}public void setBody(String body) {this.body = body;}public Integer getVisit() {return visit;}public void setVisit(Integer visit) {this.visit = visit;}public List<Comment> getCommentList() {return commentList;}public void setCommentList(List<Comment> commentList) {this.commentList = commentList;}@Overridepublic String toString() {return "Post [id=" + id + ", author=" + author + ", blog=" + blog + ", createOn=" + createOn + ", section="+ section + ", subject=" + subject + ", draft=" + draft + ", body=" + body + ", visit=" + visit + "]";}}

com.geyao.mybatis.util

MybatisUtil

package com.geyao.mybatis.util;import java.io.InputStream;
import java.io.Reader;import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;public class MyBatisUtil {private static SqlSessionFactory sqlSessionFactory =null;static {try {InputStream in = Resources.getResourceAsStream("mybatis-config.xml");sqlSessionFactory = new SqlSessionFactoryBuilder().build(in);} catch (Exception e) {// TODO Auto-generated catch blocke.printStackTrace();}}private MyBatisUtil() {}public static SqlSession getSqlSession() {return sqlSessionFactory.openSession();}
}

单元测试

com.geyao.mybatis.mapper

PostMannerTest

package com.geyao.mybatis.mapper;import org.apache.ibatis.session.SqlSession;
import org.junit.Test;import com.geyao.mybatis.pojo.Blog;
import com.geyao.mybatis.pojo.Post;
import com.geyao.mybatis.util.MyBatisUtil;public class PostMapperTest {@Testpublic void testSelectPost() {SqlSession session =MyBatisUtil.getSqlSession();PostMapper postMapper =session.getMapper(PostMapper.class);Post post = postMapper.selectPostById(1);session.close();System.out.println(post);}
}

BlogMapperTest类

package com.geyao.mybatis.mapper;import java.util.List;import org.apache.ibatis.session.SqlSession;
import org.junit.Test;import com.geyao.mybatis.pojo.Author;
import com.geyao.mybatis.pojo.Blog;
import com.geyao.mybatis.pojo.Post;
import com.geyao.mybatis.util.MyBatisUtil;public class BlogMapperTest {@Testpublic void testselectBlogListNested() {SqlSession session =MyBatisUtil.getSqlSession();BlogMapper blogMapper =session.getMapper(BlogMapper.class);List<Blog> biogList = blogMapper.selectBlogListNested();session.close();System.out.println(biogList);}@Testpublic void testselectBlogByIdConstructor() {SqlSession session =MyBatisUtil.getSqlSession();BlogMapper blogMapper =session.getMapper(BlogMapper.class);Blog biog = blogMapper.selectBlogByIdConstructor(1);session.close();System.out.println(biog);}}

VehicleMapperTest类

package com.geyao.mybatis.mapper;import org.apache.ibatis.session.SqlSession;
import org.junit.Test;import com.geyao.mybatis.mvo.BlogCustom;
import com.geyao.mybatis.pojo.Car;
import com.geyao.mybatis.pojo.Suv;
import com.geyao.mybatis.util.MyBatisUtil;public class VehicleMapperTest {@Testpublic void testselectVehicleById() {SqlSession session =MyBatisUtil.getSqlSession();VehicleMapper vehicleMapper =session.getMapper(VehicleMapper.class);Car vehicle1=(Car)vehicleMapper.selectVehicleById(1);Suv vehicle3=(Suv)vehicleMapper.selectVehicleById(3);session.close();System.out.println(vehicle1);System.out.println(vehicle3);}
}

运行结果

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/423712.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

hadoop fs:du统计hdfs文件(目录下文件)大小的用法

hadoop fs:du统计hdfs文件&#xff08;目录下文件&#xff09;大小的用法 hadoop fs 更多用法&#xff0c;请参考官网&#xff1a;http://hadoop.apache.org/docs/r1.0.4/cn/hdfs_shell.html 以下是我的使用统计文件时使用的记录&#xff1a; [tdv00938 ~]$ hadoop fs -ls /jc_…

sqoop操作之Oracle导入到HDFS

导入表的所有字段 sqoop import --connect jdbc:oracle:thin:192.168.1.100:1521:ORCL \ --username SCOTT --password tiger \ --table EMP -m 1; 查看执行结果&#xff1a; hadoop fs -cat /user/hadoop/EMP/part-m-00000 7369,SMITH,CLERK,7902,1980-12-17 00:00:00.0,800,n…

ps学习1:去除图片上的文字

首先我们看到如图所示的图&#xff0c;这个时候我们要给他右上角的文字去除 首先打开我们的ps工具--我登陆的在线ps教程 https://www.uupoop.com/ 点击编辑---填充 保存 完成修改

Java面试题16 牛客 以下java程序代码,执行后的结果是()

Java面试题16 牛客 以下java程序代码&#xff0c;执行后的结果是&#xff08;&#xff09; 1 2 3 4 5 6 7 8 9 10 public class Test { public static void main(String[] args) { Object o new Object() { public boolean equals(Object o…

Hive压缩说明

为什么要压缩 在Hive中对中间数据或最终数据做压缩&#xff0c;是提高数据吞吐量和性能的一种手段。对数据做压缩&#xff0c;可以大量减少磁盘的存储空间&#xff0c;比如基于文本的数据文件&#xff0c;可以将文件压缩40%或更多。同时压缩后的文件在磁盘间传输和I/O也会大大减…

kubelet源码学习(一):kubelet工作原理、kubelet启动过程

本文基于Kubernetes v1.22.4版本进行源码学习 1、kubelet工作原理 1&#xff09;、kubelet核心工作 kubelet的工作核心就是一个控制循环&#xff0c;即&#xff1a;SyncLoop&#xff08;图中的大圆圈&#xff09;。而驱动这个控制循环运行的事件&#xff0c;包括&#xff1a;P…

Java面试题18 牛客 假定Base b = new Derived();

Java面试题18 牛客 假定Base b new Derived&#xff08;&#xff09;; 调用执行b.methodOne&#xff08;&#xff09;后&#xff0c;输出结果是什么&#xff1f; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 public class Base { public…

ReactOS,硬件抽象层,HAL概述

分析环境reactos0.3.4 &#xff0c;i386体系] ReactOS的硬件抽象层 HAL(Hardware Abstraction Layer)位于OS与硬件的中间&#xff0c;和windows的hal原理基本一致&#xff0c;硬件抽象层隐藏特定平台的硬件接口细节&#xff0c;为上层的系统提供标准的稳定的虚拟硬件平台&…

[给ASP.NET 初学者的话]不要练功练了三年,才发现自己必须「砍掉重练」!....学习ASP.NET之前,请先把自己杯中的水倒掉...

这是我的文章备份&#xff0c;原文请看&#xff1a; [给ASP.NET 初学者的话]不要练功练了三年&#xff0c;才发现自己必须「砍掉重练」&#xff01;....学习ASP.NET之前&#xff0c;请先把自己杯中的水倒掉 http://www.dotblogs.com.tw/mis2000lab/archive/2012/03/15/game_ove…

Java面试题19 牛客下面有关java的引用类型,说法正确的有?

Java面试题19下面有关java的引用类型&#xff0c;说法正确的有&#xff1f; A:对于一个对象来说&#xff0c;只要有强引用的存在&#xff0c;它就会一直存在于内存中 B&#xff1a;如果一个对象仅持有虚引用&#xff0c;那么它就和没有任何引用一样&#xff0c;在任何时候都可…

MapReduce运行机制

相关链接 MapReduce中Shuffle机制详解——Map端Shuffle链接 MapReduce中Shuffle机制详解——Reduce端Shuffle链接MapReduce将作业job的整个运行过程分为两个阶段&#xff1a;Map阶段和Reduce阶段。按照时间顺序包括&#xff1a;输入分片&#xff08;input split&#xff09;、m…

WebService Software Factory 设计草图

以下是根据WSSF设计理念&#xff0c;按现公司的业务需求设计的接口项目拟稿&#xff0c;实现细分。仅供参考。&#xff08;WSSF---ASMX版&#xff09; 建议用1680*1050分辩浏览 转载于:https://www.cnblogs.com/RuiLei/archive/2008/10/05/1304160.html

Java面试题 20在面向对象编程里,经常使用is-a来说明对象之间的继承关系

Java面试题 20在面向对象编程里&#xff0c;经常使用is-a来说明对象之间的继承关系&#xff0c;下列对象中不具备继承关系的是&#xff1f;&#xff08;&#xff09; A:手机与小米手机 B&#xff1a;企业家与雷军 C:编程语言与Java D&#xff1a;中国与北京 类之间存在以下…

MapReduce计数器

原文链接&#xff1a;http://itfish.net/article/61067.html 1、MapReduce计数器是什么&#xff1f;计数器是用来记录job的执行进度和状态的。它的作用可以理解为日志。我们可以在程序的某个位置插入计数器&#xff0c;记录数据或者进度的变化情况。 2、MapReduce计数器能做什么…

编写“线围棋”程序-2-可开局

棋盘有了&#xff0c;怎么支持在上面落子呢&#xff1f; 只要解决下面3个问题就可以了&#xff1a; 1.响应鼠标点击事件&#xff0c;获得“下棋子”的动作源。 2.修改和记录棋局状态。 3.在棋盘上显示棋局的状态。 为此&#xff0c;直接增加一个“棋局类“&#xff0c;也就是对…

Java面试题 21 下列说法正确的有()

下列说法正确的有&#xff08;&#xff09; A 能被java.exe成功运行的java class文件必须有main()方法 B J2SDK就是Java API C:Appletviewer.exe可利用jar选项运行.jar文件 D能被Appletviewer成功运行的java class文件必须有main()方法 蒙蔽树上蒙蔽果&#xff0c;蒙蔽树下…

[翻译]SQL Server 未公开的两个存储过程sp_MSforeachtable 和 sp_MSforeachdb

SQL Server 未公开的两个存储过程sp_MSforeachtable 和 sp_MSforeachdb 您是否曾经写过代码来处理数据库中的所有表&#xff1f;处理一个 SQL Server实例中的所有数据库的代码又该如何写&#xff1f;然则&#xff0c;您是否知道有多种方法可以解决这问题&#xff1f;您可以创建…

Java面试题 22 牛客 Java是一门支持反射的语言,基于反射为Java提供了丰富的动态性支持

Java面试题 22 牛客 Java是一门支持反射的语言,基于反射为Java提供了丰富的动态性支持&#xff0c;下面关于Java反射的描述&#xff0c;哪些是错误的&#xff1a;( ) A Java反射主要涉及的类如Class, Method, Filed,等&#xff0c;他们都在java.lang.reflet包下 B 通…

java面试题24 关于Java中的数组,

java面试题24 关于Java中的数组&#xff0c;下面的一些描述&#xff0c;哪些描述是准确的&#xff1a;&#xff08; &#xff09; A 数组是一个对象&#xff0c;不同类型的数组具有不同的类 B 数组长度是可以动态调整的 C 数组是一个连续的存储结构 D:一个固定长度的…

[开发技巧3]不显示报表直接打印

水晶报表9.2VB6 使用Application可以进行打印 在将数据赋给报表模板后&#xff0c;调用PrintOut方法 赋给报表数据objCRReport.Database.SetDataSource rst 此句打印&#xff0c;会出现打印提示框objCRReport.PrintOut 不提示&#xff0c;直接打印到默认打印机CallobjCRReport.…