`

JAVA_JDBC面向对象分页(初步设计二之oracle)

    博客分类:
  • JAVA
阅读更多

现在加入oracle和sql2005的分页代码实现;

sql2005测试数据脚本:

USE master
go
IF DB_ID('paginationdb') IS NOT NULL
DROP DATABASE paginationdb
GO

----建库
CREATE DATABASE paginationdb
GO
----建表
USE paginationdb
IF EXISTS (SELECT  name FROM sysobjects WHERE [name]='student_')
DROP TABLE student_
GO
----创建用户信息表
CREATE TABLE student_
(
	id_ INT NOT NULL IDENTITY (1,1) PRIMARY KEY,
	name_ varchar(50),
	sex_ varchar(50),
	age_ int,
	grade_ varchar(50),
	class_ varchar(50)
)
GO
--插入测试数据
INSERT INTO student_(name_,sex_,age_,grade_,class_)
SELECT 'student1'	,'男',	11	,'一年级'	,'二班' UNION
SELECT 'student2'	,'男',	12	,'一年级'	,'二班' UNION
SELECT 'student3'	,'男',	13	,'一年级'	,'二班' UNION
SELECT 'student4'	,'女',	14	,'一年级'	,'二班' UNION
SELECT 'student5'	,'女',	15	,'一年级'	,'二班' UNION
SELECT 'student6'	,'男',	16	,'二年级'	,'一班' UNION
SELECT 'student7'	,'男',	17	,'二年级'	,'一班' UNION
SELECT 'student8'	,'女',	18	,'一年级'	,'一班' UNION
SELECT 'story1'	,'男',	19	,'一年级'	,'二班' UNION
SELECT 'story2'	,'女',	11	,'一年级'	,'一班' UNION
SELECT 'story3'	,'男',	12	,'二年级'	,'一班' UNION
SELECT 'story4'	,'女',	13	,'一年级'	,'二班' UNION
SELECT 'story5'	,'男',	14	,'一年级'	,'一班' UNION
SELECT 'story6'	,'男',	15	,'一年级'	,'一班' UNION
SELECT 'story7'	,'女',	16	,'一年级'	,'二班' UNION
SELECT 'story8'	,'男',	17	,'一年级'	,'二班' UNION
SELECT 'story9'	,'男',	18	,'一年级'	,'二班' UNION
SELECT 'story8'	,'男',	15	,'一年级'	,'二班' UNION
SELECT 'story8'	,'男',	16	,'一年级'	,'二班' UNION
SELECT 'story10'	,'保密',	16	,'一年级'	,'二班' 
GO

oracle测试数据:

//创建学生表
CREATE TABLE STUDENT_
(
	ID_ INT PRIMARY KEY,
	NAME_ VARCHAR2(50),
	SEX_ VARCHAR2(50),
	AGE_ INT,
	GRADE_ VARCHAR2(50),
	CLASS_ VARCHAR2(50)
)
//为学生表创建序列
CREATE SEQUENCE SEQ_STUDENT_ID;
//插入测试数据
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'student1','男',11,'一年级','二班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'student2','男',12,'一年级','二班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'student3','男',13,'一年级','二班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'student4','女',14,'一年级','二班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'student5','女',15,'一年级','二班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'student6','男',16,'二年级','一班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'student7','男',17,'二年级','一班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'student8','女',18,'一年级','一班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'story1','男',19,'一年级','二班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'story2','女',11,'一年级','一班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'story3','男',12,'二年级','一班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'story4','女',13,'一年级','二班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'story5','男',14,'一年级','一班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'story6','男',15,'一年级','一班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'story7','女',16,'一年级','二班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'story8','男',17,'一年级','二班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'story9','男',18,'一年级','二班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'story8','男',15,'一年级','二班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'story8','男',16,'一年级','二班');
INSERT INTO STUDENT_ VALUES (SEQ_STUDENT_ID.NEXTVAL,'story10','保密',16,'一年级','二班');
COMMIT;

  

 

重构StudentManager类:

package org.forever.manager;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import oracle.jdbc.driver.OracleDriver;

import org.forever.entities.Condition;
import org.forever.entities.Operation;
import org.forever.entities.Order;
import org.forever.entities.OrderType;
import org.forever.entities.PageInfo;
import org.forever.entities.Student;

import com.mysql.jdbc.Driver;

public class StudentManager {
	
	//基于oracle10g数据库
	public void doPagerOracle(PageInfo pageInfo){
		
		String sqlPage =
				" SELECT * FROM "+
				" (SELECT ROWNUM  NUM,@TABLE_NAME.* FROM @TABLE_NAME WHERE (1=1) AND (ROWNUM<=(@CURRENT_PAGE*@PAGE_SIZE)) @CONDITIONS @ORDERS ) "+
				" WHERE NUM>(@CURRENT_PAGE-1)*@PAGE_SIZE "
				;
		String sqlCount = " SELECT COUNT(*) FROM @TABLE_NAME WHERE 1=1 @CONDITIONS ";

		//处理条件
		List<Object> params = new ArrayList<Object>();
		String conditions = processCondition(pageInfo, params);
		//处理排序
		String orderList = processOrder(pageInfo);
		//获取完整分页语句
		String sqlp=sqlPage.replaceAll("@CONDITIONS",conditions)
						   .replaceAll("@ORDERS", orderList)
						   .replaceAll("@TABLE_NAME", pageInfo.getTableName())
						   .replaceAll("@PAGE_SIZE", pageInfo.getPageSize()+"")
						   .replaceAll("@CURRENT_PAGE", pageInfo.getCurrentPage()+"");
		//获取完整的统计语句
		String sqlc = sqlCount.replaceAll("@CONDITIONS", conditions)
							  .replaceAll("@TABLE_NAME", pageInfo.getTableName());
		
		Connection connection = null;
		PreparedStatement statement = null;
		ResultSet resultSet = null;
		try {
			Class.forName(OracleDriver.class.getName());
			connection = DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.101:1521:ORCL", "scott", "story");
			statement = connection.prepareStatement(sqlc);
			for (int i = 0; i < params.size(); i++) {
				statement.setObject(i+1, params.get(i));
			}
			resultSet = statement.executeQuery();
			resultSet.next();
			int totalItems = resultSet.getInt(1);
			//设置总条数
			pageInfo.setTotalItems(totalItems);
			//设置总页数
			pageInfo.setTotalPage(
					totalItems%pageInfo.getPageSize()==0?
							totalItems/pageInfo.getPageSize():
								totalItems/pageInfo.getPageSize()+1
			);
			//设置结果集
			statement = connection.prepareStatement(sqlp);
			for (int i = 0; i < params.size(); i++) {
				statement.setObject(i+1, params.get(i));
			}
			resultSet = statement.executeQuery();
			List<Student> students = new ArrayList<Student>();
			while(resultSet.next()){
				Student student = new Student();
				student.setId(resultSet.getInt("ID_"));
				student.setName(resultSet.getString("NAME_"));
				student.setSex(resultSet.getString("SEX_"));
				student.setAge(resultSet.getInt("AGE_"));
				student.setGrade(resultSet.getString("GRADE_"));
				student.setStuClass(resultSet.getString("CLASS_"));
				students.add(student);
			}
			
			pageInfo.setResult(students);
			
		} catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}finally{
			if(connection!=null){
				try {
					connection.close();
				} catch (SQLException e) {
					e.printStackTrace();
					throw new RuntimeException(e);
				}
			}
		}
	}
	
	//基于sql2005数据库
	public void doPagerSql2k5(PageInfo pageInfo){
		
		StringBuffer sqlPage = new StringBuffer(
				" SELECT TOP(@PAGE_SIZE) * FROM @TABLE_NAME WHERE 1=1 AND @PKEY NOT IN "+
				" (SELECT TOP((@CURRENT_PAGE-1)*@PAGE_SIZE) @PKEY FROM @TABLE_NAME WHERE 1=1 @CONDITIONS @ORDERS) "+
				" @CONDITIONS @ORDERS "
		);
		
		StringBuffer sqlCount = new StringBuffer(
				" SELECT COUNT(*) FROM @TABLE_NAME WHERE 1=1 @CONDITIONS "
		);
		
		//处理条件
		List<Object> params = new ArrayList<Object>();
		String conditions = processCondition(pageInfo, params);
		//处理排序
		String orderList = processOrder(pageInfo);
		//获取完整分页语句
		String sqlp=sqlPage.toString()
					.replaceAll("@CONDITIONS", conditions)
					.replaceAll("@ORDERS", orderList)
					.replaceAll("@TABLE_NAME", pageInfo.getTableName())
					.replaceAll("@PKEY", pageInfo.getPkey())
					.replaceAll("@PAGE_SIZE", pageInfo.getPageSize()+"")
					.replaceAll("@CURRENT_PAGE", pageInfo.getCurrentPage()+"");
		//获取完整统计语句
		String sqlc=sqlCount.toString()
					.replaceAll("@CONDITIONS", conditions)
					.replaceAll("@TABLE_NAME", pageInfo.getTableName());
		Connection connection = null;
		PreparedStatement statement = null;
		ResultSet resultSet = null;
		
		try {
			Class.forName(net.sourceforge.jtds.jdbc.Driver.class.getName());
			connection = DriverManager.getConnection("jdbc:jtds:sqlserver://localhost:1151/paginationdb", "sa", "123456");
			statement = connection.prepareStatement(sqlc);
			for (int i = 0; i < params.size(); i++) {
				statement.setObject(i+1, params.get(i));
			}
			resultSet = statement.executeQuery();
			resultSet.next();
			int totalItems = resultSet.getInt(1);
			//设置总条数
			pageInfo.setTotalItems(totalItems);
			//设置总页数
			pageInfo.setTotalPage(
					totalItems%pageInfo.getPageSize()==0?
							totalItems/pageInfo.getPageSize():
								totalItems/pageInfo.getPageSize()+1
			);
			//设置结果集
			statement = connection.prepareStatement(sqlp);
			//因为涉及两个conditions,所以参数是2倍
			for (int i = 0; i < params.size(); i++) {
				statement.setObject(i+1, params.get(i));
			}
			for (int i = params.size(); i < params.size()*2; i++) {
				statement.setObject(i+1, params.get(i-params.size()));
			}

			resultSet = statement.executeQuery();
			List<Student> students = new ArrayList<Student>();
			while(resultSet.next()){
				Student student = new Student();
				student.setId(resultSet.getInt("id_"));
				student.setName(resultSet.getString("name_"));
				student.setSex(resultSet.getString("sex_"));
				student.setAge(resultSet.getInt("age_"));
				student.setGrade(resultSet.getString("grade_"));
				student.setStuClass(resultSet.getString("class_"));
				students.add(student);
			}
			
			pageInfo.setResult(students);
			
		} catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException(e);
		}finally{
			if(connection!=null){
				try {
					connection.close();
				} catch (SQLException e) {
					e.printStackTrace();
					throw new RuntimeException(e);
				}
			}
		}
			
	}
	
	//基于mysql数据库
	public void doPagerMysql(PageInfo pageInfo){
		
		StringBuffer sqlPage = new StringBuffer("SELECT * FROM @TABLE_NAME WHERE 1=1 @CONDITIONS @ORDERS LIMIT @FIRST_INDEX,@PAGE_SIZE ");
		StringBuffer sqlCount = new StringBuffer("SELECT COUNT(*) FROM @TABLE_NAME WHERE 1=1 @CONDITIONS ") ;
		
		//处理条件
		List<Object> params = new ArrayList<Object>();
		String conditions = processCondition(pageInfo, params);
		
		//处理排序
		String orderList = processOrder(pageInfo);

		//获取完整分页语句
		String sqlp=sqlPage.toString()
					.replaceAll("@CONDITIONS", conditions)
					.replaceAll("@ORDERS", orderList)
					.replaceAll("@TABLE_NAME", pageInfo.getTableName())
					.replaceAll("@PKEY", pageInfo.getPkey())
					.replaceAll("@FIRST_INDEX", (pageInfo.getCurrentPage()-1)*pageInfo.getPageSize()+"")
					.replaceAll("@PAGE_SIZE", pageInfo.getPageSize()+"");
		
		//获取完整统计语句
		String sqlc = sqlCount.toString()
					.replaceAll("@CONDITIONS", conditions)
					.replaceAll("@TABLE_NAME", pageInfo.getTableName());
		
		Connection connection = null;
		PreparedStatement statement = null;
		ResultSet resultSet = null;
		
		try {
			Class.forName(Driver.class.getName());
			connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/paginationdb", "root", "root");
			statement = connection.prepareStatement(sqlc);
			for (int i = 0; i < params.size(); i++) {
				statement.setObject(i+1, params.get(i));
			}
			resultSet = statement.executeQuery();
			resultSet.next();
			int totalItems = resultSet.getInt(1);
			//设置总条数
			pageInfo.setTotalItems(totalItems);
			//设置总页数
			pageInfo.setTotalPage(
					totalItems%pageInfo.getPageSize()==0?
							totalItems/pageInfo.getPageSize():
								totalItems/pageInfo.getPageSize()+1
			);
			//设置结果集
			statement = connection.prepareStatement(sqlp);
			for (int i = 0; i < params.size(); i++) {
				statement.setObject(i+1, params.get(i));
			}
			resultSet = statement.executeQuery();
			List<Student> students = new ArrayList<Student>();
			while(resultSet.next()){
				Student student = new Student();
				student.setId(resultSet.getInt("id_"));
				student.setName(resultSet.getString("name_"));
				student.setSex(resultSet.getString("sex_"));
				student.setAge(resultSet.getInt("age_"));
				student.setGrade(resultSet.getString("grade_"));
				student.setStuClass(resultSet.getString("class_"));
				students.add(student);
			}
			
			pageInfo.setResult(students);
			
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			if(connection!=null){
				try {
					connection.close();
				} catch (SQLException e) {
					e.printStackTrace();
				}
			}
		}
	}
	
	//处理条件
	public String processCondition(PageInfo pageInfo,List<Object> params){
		StringBuffer condition = new StringBuffer();
		Condition[]conditions = pageInfo.getConditions();
		if(conditions!=null && conditions.length>0){
			for (Condition item : conditions) {
				
				switch (item.getOperation()) {
				case EQ:
					condition.append(" AND (" + item.getPropertyName()+" =?) ");
					break;
				case LIKE:
					condition.append(" AND (" + item.getPropertyName()+" LIKE ?) ");
					break;
				case BETWEEN:
					condition.append(" AND (" + item.getPropertyName() + " BETWEEN ? AND ?) ");
					break;
				case IN:
					condition.append(" AND (" + item.getPropertyName() + " IN (");
					for (int i = 0; i < ((Object[])item.getPropertyValue()).length; i++) {
						condition.append("?,");
					}
					condition.replace(condition.length()-1, condition.length(), "");
					condition.append(")) ");
					//.....
				default:
					break;
				}
				
				if(item.getOperation() == Operation.LIKE){
					params.add("%"+item.getPropertyValue()+"%");
				}else if(item.getOperation() == Operation.BETWEEN){
					params.add(((Object[])item.getPropertyValue())[0]);
					params.add(((Object[])item.getPropertyValue())[1]);
				}else if(item.getOperation() == Operation.IN){
					for (Object object : (Object[])item.getPropertyValue()) {
						params.add(object);
					}
				}else{
					params.add(item.getPropertyValue());
				}
				
				
			}
		}
		return condition.toString();
	}
	
	//处理排序
	public String processOrder(PageInfo pageInfo){
		Order[]orders = pageInfo.getOrders();
		StringBuffer orderList = new StringBuffer(" ORDER BY ");
		if(orders!=null && orders.length>0){
			for (Order item : orders) {
				switch (item.getOrderType()) {
				case ASC:
					orderList.append(item.getPropertyName()+" ASC ,");
					break;
						
				case DESC:
					orderList.append(item.getPropertyName()+" DESC ,");
					break;
				}
			}
			orderList.replace(orderList.length()-1, orderList.length(), "");
		}else{
			orderList.append(" @PKEY ASC ");
		}
		return orderList.toString();
	}
	
	
	public static void main(String[] args) {
		StudentManager studentManager = new StudentManager();
		PageInfo pageInfo = new PageInfo();
		pageInfo.setTableName("student_");//指定查询表名
		pageInfo.setPkey("id_");//指定该表的主键名
		pageInfo.setPageSize(2);//每页显示2条
		pageInfo.setCurrentPage(2);//查看第二页
		
		//实体暂时没有和数据库进行映射,所以条件和排序里面的属性名暂时写成数据库的属性名
		
		/*例子:查询一年级二班,名字中包含stor的,年龄在14到18的,性别是男和女的学生
		 *并且按照姓名升序排序,名字相同的按照年龄的逆序排序。 
		 */
		pageInfo.setConditions(
				new Condition[]{
					new Condition("grade_", "一年级", Operation.EQ),	
					new Condition("class_", "二班", Operation.EQ),
					new Condition("name_","stor",Operation.LIKE),
					new Condition("age_", new Object[]{14,18}, Operation.BETWEEN),
					new Condition("sex_",new Object[]{"男","女"},Operation.IN)
				}
		);
		
		pageInfo.setOrders(
				new Order[]{
					new Order("name_", OrderType.ASC),
					new Order("age_",OrderType.DESC)
				}
		);
//		System.out.println("************mysql分页*****************");
//		studentManager.doPagerMysql(pageInfo);
//		System.out.println("totalPage:"+pageInfo.getTotalPage());
//		System.out.println("totalItems:" + pageInfo.getTotalItems());
//		for (Object item : pageInfo.getResult()) {
//			System.out.println("***************");
//			System.out.println(((Student)item).getId());
//			System.out.println(((Student)item).getName());
//			System.out.println(((Student)item).getSex());
//		}
		
//		System.out.println("**************sql2005分页*****************");
//		studentManager.doPagerSql2k5(pageInfo);
//		System.out.println("totalPage:"+pageInfo.getTotalPage());
//		System.out.println("totalItems:" + pageInfo.getTotalItems());
//		for (Object item : pageInfo.getResult()) {
//			System.out.println("***************");
//			System.out.println(((Student)item).getId());
//			System.out.println(((Student)item).getName());
//			System.out.println(((Student)item).getSex());
//		}
		System.out.println("**************ORACLE分页*****************");
		studentManager.doPagerOracle(pageInfo);
		System.out.println("totalPage:"+pageInfo.getTotalPage());
		System.out.println("totalItems:" + pageInfo.getTotalItems());
		for (Object item : pageInfo.getResult()) {
			System.out.println("***************");
			System.out.println(((Student)item).getId());
			System.out.println(((Student)item).getName());
			System.out.println(((Student)item).getSex());
		}
		
		
		
	}
	
}

 

0
0
分享到:
评论

相关推荐

    jdbc.rar_WORKING_jdbc

    **Java Database Connectivity (JDBC)** 是Java编程语言中用于与各种数据库进行交互的一组标准API。JDBC允许Java开发者执行SQL语句并处理结果。它作为Oracle公司开发的Java平台的一部分,是Java开发者连接到关系型...

    完美整合(通用分页)SSH+Oracle (需要自己加入jar包,只是源码)

    Hibernate**:Hibernate作为ORM(对象关系映射)工具,将Java对象与数据库表进行映射,使得开发者可以以面向对象的方式来操作数据库。在整合过程中,需要配置Hibernate的实体类、持久化配置文件(hibernate.cfg.xml...

    Java程序设计课程设计Oracle数据库课程设计

    1. **Java程序设计**:Java是一种跨平台的面向对象的编程语言,具有丰富的类库和强大的功能。在这个项目中,Java被用来编写应用程序的后端逻辑,处理用户请求,执行业务逻辑,并与数据库进行通信。 2. **Oracle...

    AOP.rar_java aop_oracle

    Java AOP(面向切面编程)是一种编程范式,它允许程序员定义“切面”,这些切面封装了特定关注点的实现,如日志、事务管理或安全性。在本示例中,`AOP.rar` 文件显然包含了与Java AOP相关的代码实现,可能是为了改善...

    s2sh基础框架实现增,删改查及分页的功能。连接oracle

    3. **Hibernate框架**:Hibernate是Java领域的一个ORM(对象关系映射)框架,它允许开发者以面向对象的方式操作数据库,降低了SQL与Java代码的耦合度。在CRUD操作中,Hibernate通过实体类和映射文件(hbm.xml)实现...

    java培训笔记Hibernate ejb oracle,struts,分页,购物车

    1. **Core Java**: Core Java是Java编程的基础,主要包括面向对象编程概念、类和对象、封装、继承、多态、异常处理、集合框架(如ArrayList、LinkedList、HashMap等)、输入/输出流以及线程管理。理解并熟练掌握Core...

    达内笔记(CoreJava.pdf、EJBNote.pdf、Hibernate.pdf、HTML.pdf、JDBC.pdf、JSP.pdf、Oracle SQL.pdf、Servlet.pdf、Struts.pdf、XML.pdf、分页.pdf、购物车.pdf)

    1. **核心Java(CoreJava)**:这是Java编程的基础,包含了面向对象编程概念、类和对象、封装、继承、多态性、异常处理、集合框架、IO流、线程以及网络编程等内容。学习者需要掌握Java语法和基本编程技巧,为后续的...

    java成绩管理系统_JAVA成绩管理_java系统_

    Java成绩管理系统是一个基于Java编程语言开发的软件应用,主要用于高校或教育机构对学生考试成绩的高效管理。这个系统利用了数据库技术来存储、检索和处理大量的学生成绩数据,实现了成绩的增、删、改、查等基本操作...

    JDBC_t_paper.zip

    它们提供了更高级别的抽象,使开发者能够以面向对象的方式操作数据库,提高了开发效率和代码可维护性。 总结,JDBC作为Java与数据库交互的基础,其掌握程度直接影响到Java开发者的数据库操作能力。理解并熟练运用...

    ssh Struts2.2+Hibernate3.6+Spring3.1+oracle 分页示例.zip

    **Hibernate** 是一个对象关系映射(ORM)框架,它允许Java开发者将数据库操作转换为面向对象的方式。Hibernate3.6版本优化了性能,增强了对JPA的支持,并提供了更丰富的查询API,包括HQL(Hibernate Query Language...

    oracle-pagehelper-通用mapper-easyui-SSM框架示例

    综上所述,"oracle-pagehelper-通用mapper-easyui-SSM框架示例"是一个完整的Java Web项目,利用SSM框架连接Oracle数据库,通过PageHelper实现分页查询,通用Mapper简化数据库操作,EasyUI构建用户友好的前端界面。...

    java课程大纲

    本课程大纲涵盖了 Java 语言的核心语法、面向对象编程、数据结构、网络编程、数据库编程、Web 开发、Java EE 架构等方面的知识点。 Java 核心语法 * JDK 配置和 Eclipse 开发工具使用 * 变量、数据类型、表达式、...

    人事管理系统_java开发项目_源码

    Java作为一种跨平台的编程语言,具有面向对象、健壮性、安全性、可移植性等诸多优点,使其成为开发企业级应用的首选。本项目中,Java作为后端开发语言,负责处理业务逻辑和数据交互。 二、数据库管理 系统利用...

    JAVA开发java论坛管理系统设计(源代码+论文)

    1. **Java编程语言**:作为基础开发工具,Java具有跨平台、面向对象的特点,适用于开发大型分布式应用。此项目中,Java可能用于编写控制层、业务逻辑层和数据访问层的代码。 2. **MVC(Model-View-Controller)设计...

    JDBC API 参考教程第三版

    面向对象的JDBC - **DataSource**:JNDI服务中的数据源对象,提供更高效的连接池管理和连接复用。 ### 8. 其他高级特性 - **JDBC逃逸**:防止SQL注入攻击,使用PreparedStatement并设置参数。 - **结果集缓存**...

    Java课程设计报告-图书管理系统

    在软件工程的学习过程中,这样的项目是常见的实践环节,旨在加深对面向对象编程、数据库连接、用户界面设计等核心概念的理解。下面将详细阐述这个系统的主要组成部分及其涉及到的关键知识点。 1. **系统架构** - *...

    HIbernate与oracle数据库应用例子

    通过ORM,开发者可以使用面向对象的方式来处理数据,而无需直接编写SQL语句。这大大提高了开发效率并降低了维护成本。 二、Oracle数据库简介 Oracle数据库是Oracle公司的旗舰产品,提供高性能、高可用性和安全性。...

    Java教材管理系统

    - **核心Java**: 系统的基础是Java SE(Java Standard Edition),包括面向对象编程、异常处理、集合框架、多线程、输入/输出流等基础概念。 - **Servlet与JSP**: 作为Web应用开发的重要组成部分,Servlet负责处理...

    最新Java面试题视频网盘,Java面试题84集、java面试专属及面试必问课程

    │ Java面试题05.java面向对象的特征.mp4 │ Java面试题06.装箱和拆箱.mp4 │ Java面试题07.==和equals的区别.mp4 │ Java面试题08.String.mp4 │ Java面试题09.讲一下java中的集合.mp4 │ Java面试题10.ArrayList ...

Global site tag (gtag.js) - Google Analytics