- 浏览: 307904 次
- 性别:
- 来自: 成都
文章分类
- 全部博客 (118)
- VS2008 (2)
- JAVA (34)
- AJAX (1)
- C# (1)
- Flex (16)
- FMS (6)
- SQLSERVER (1)
- ORACLE (1)
- Quartz (1)
- struts2 (1)
- java数据结构 (1)
- java设计模式 (3)
- JSF (0)
- web (2)
- jbpm4 (4)
- J2EE (1)
- webservice (2)
- javascript (8)
- spring (3)
- lucene (0)
- linux (9)
- ibatis (1)
- JPA (2)
- 外挂 (0)
- VB (0)
- Hibernate (1)
- OSGI (8)
- EXT (4)
- Maven (1)
- SpringSecurity (0)
- activiti (0)
- 项目开发 (0)
- 项目管理 (7)
- android (0)
- FFMPEG (1)
- C (2)
- eclipse (1)
最新评论
-
默默得守候在你的身边:
给力
java与Delphi写的dll交互 -
默默得守候在你的身边:
java与Delphi写的dll交互 -
fuguitong:
[url][url][url][url][url][url][ ...
doc转swf -
baidu_25402161:
到结束的时候一直 Can't delete processIn ...
一个请假单流程的实现(struts2.1.8+spring2.5+hibernate3集成jbpm4.3) -
lohaoo1:
nice!
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()); } } }
- pagination_第二篇_.rar (23.7 KB)
- 下载次数: 17
发表评论
-
OSGI学习
2012-03-18 18:01 0http://www.blogjava.net/zhenyu3 ... -
OSGI学习笔记(七)
2012-03-17 23:58 1693SpringDM初步使用(二) 介绍哈官方的第二个例子 ... -
ubuntu10.04下nexus和maven的安装及配置
2012-03-14 16:14 2510前提要有jdk环境,官方下载nexus和maven,解压后创建 ... -
ubuntu10.04下eclipse的安装及配置
2012-03-14 00:01 1307从官方http://www.eclipse.org/downl ... -
Ubuntu10.04下配置java环境变量
2012-03-13 23:28 1066Ubuntu10.04默认安装了OpenJDK,但还是基于Su ... -
eclipse设置保护色
2012-03-16 09:22 9414eclipse操作界面默认颜色为白色。对于我们长期使 ... -
OSGI学习笔记(六)
2012-03-17 15:08 2754SpringDM初步使用(一) 官方地址http:// ... -
OSGI学习笔记(八)
2012-03-19 21:08 2301SpringDM初步使用(三) spring第三个例子 ... -
OSGI学习笔记(五)
2011-07-31 10:32 1586开放服务网关协议 (Open Services Gateway ... -
osgi学习笔记(三)
2011-07-16 22:43 1960OSGI实战书上讲了一个web登陆验证切换功能。表达了osgi ... -
word工具类
2011-03-15 09:19 1443package org.foreverframework ... -
命令模式--撤销恢复
2011-03-14 22:32 4985该例子来自阎宏提供的 ... -
java zip
2011-03-06 15:32 1215import java.io.BufferedInputStr ... -
doc转swf
2010-12-07 22:03 8540将doc转换成swf,然后显示在html页面上。 packa ... -
javamail简单使用
2010-11-15 08:29 2350MailInfo类: //发送邮件的信息类 public ... -
xloadtree的一个改造
2010-09-20 22:58 2568修改了xloadtree的部分源码以适合自己使用。 1.修改 ... -
java与Delphi写的dll交互
2010-09-05 22:27 6161有时候在项目开发的时候难免会和硬件提供的开发包接触,这些开发接 ... -
JAVA与DLL交互
2010-08-27 23:32 1945jna官网地址:https://jna.dev.java.ne ... -
office工具类
2010-07-31 14:17 2309将jcom.dll放入jdk的bin目录下,将jcom.jar ... -
启动多个tomcat
2010-04-22 09:13 1214想启动多个tomcat,只需修改conf/server.xml ...
相关推荐
**Java Database Connectivity (JDBC)** 是Java编程语言中用于与各种数据库进行交互的一组标准API。JDBC允许Java开发者执行SQL语句并处理结果。它作为Oracle公司开发的Java平台的一部分,是Java开发者连接到关系型...
Hibernate**:Hibernate作为ORM(对象关系映射)工具,将Java对象与数据库表进行映射,使得开发者可以以面向对象的方式来操作数据库。在整合过程中,需要配置Hibernate的实体类、持久化配置文件(hibernate.cfg.xml...
1. **Java程序设计**:Java是一种跨平台的面向对象的编程语言,具有丰富的类库和强大的功能。在这个项目中,Java被用来编写应用程序的后端逻辑,处理用户请求,执行业务逻辑,并与数据库进行通信。 2. **Oracle...
Java AOP(面向切面编程)是一种编程范式,它允许程序员定义“切面”,这些切面封装了特定关注点的实现,如日志、事务管理或安全性。在本示例中,`AOP.rar` 文件显然包含了与Java AOP相关的代码实现,可能是为了改善...
3. **Hibernate框架**:Hibernate是Java领域的一个ORM(对象关系映射)框架,它允许开发者以面向对象的方式操作数据库,降低了SQL与Java代码的耦合度。在CRUD操作中,Hibernate通过实体类和映射文件(hbm.xml)实现...
1. **Core Java**: Core Java是Java编程的基础,主要包括面向对象编程概念、类和对象、封装、继承、多态、异常处理、集合框架(如ArrayList、LinkedList、HashMap等)、输入/输出流以及线程管理。理解并熟练掌握Core...
1. **核心Java(CoreJava)**:这是Java编程的基础,包含了面向对象编程概念、类和对象、封装、继承、多态性、异常处理、集合框架、IO流、线程以及网络编程等内容。学习者需要掌握Java语法和基本编程技巧,为后续的...
Java成绩管理系统是一个基于Java编程语言开发的软件应用,主要用于高校或教育机构对学生考试成绩的高效管理。这个系统利用了数据库技术来存储、检索和处理大量的学生成绩数据,实现了成绩的增、删、改、查等基本操作...
它们提供了更高级别的抽象,使开发者能够以面向对象的方式操作数据库,提高了开发效率和代码可维护性。 总结,JDBC作为Java与数据库交互的基础,其掌握程度直接影响到Java开发者的数据库操作能力。理解并熟练运用...
**Hibernate** 是一个对象关系映射(ORM)框架,它允许Java开发者将数据库操作转换为面向对象的方式。Hibernate3.6版本优化了性能,增强了对JPA的支持,并提供了更丰富的查询API,包括HQL(Hibernate Query Language...
综上所述,"oracle-pagehelper-通用mapper-easyui-SSM框架示例"是一个完整的Java Web项目,利用SSM框架连接Oracle数据库,通过PageHelper实现分页查询,通用Mapper简化数据库操作,EasyUI构建用户友好的前端界面。...
本课程大纲涵盖了 Java 语言的核心语法、面向对象编程、数据结构、网络编程、数据库编程、Web 开发、Java EE 架构等方面的知识点。 Java 核心语法 * JDK 配置和 Eclipse 开发工具使用 * 变量、数据类型、表达式、...
Java作为一种跨平台的编程语言,具有面向对象、健壮性、安全性、可移植性等诸多优点,使其成为开发企业级应用的首选。本项目中,Java作为后端开发语言,负责处理业务逻辑和数据交互。 二、数据库管理 系统利用...
1. **Java编程语言**:作为基础开发工具,Java具有跨平台、面向对象的特点,适用于开发大型分布式应用。此项目中,Java可能用于编写控制层、业务逻辑层和数据访问层的代码。 2. **MVC(Model-View-Controller)设计...
面向对象的JDBC - **DataSource**:JNDI服务中的数据源对象,提供更高效的连接池管理和连接复用。 ### 8. 其他高级特性 - **JDBC逃逸**:防止SQL注入攻击,使用PreparedStatement并设置参数。 - **结果集缓存**...
在软件工程的学习过程中,这样的项目是常见的实践环节,旨在加深对面向对象编程、数据库连接、用户界面设计等核心概念的理解。下面将详细阐述这个系统的主要组成部分及其涉及到的关键知识点。 1. **系统架构** - *...
通过ORM,开发者可以使用面向对象的方式来处理数据,而无需直接编写SQL语句。这大大提高了开发效率并降低了维护成本。 二、Oracle数据库简介 Oracle数据库是Oracle公司的旗舰产品,提供高性能、高可用性和安全性。...
- **核心Java**: 系统的基础是Java SE(Java Standard Edition),包括面向对象编程、异常处理、集合框架、多线程、输入/输出流等基础概念。 - **Servlet与JSP**: 作为Web应用开发的重要组成部分,Servlet负责处理...
│ Java面试题05.java面向对象的特征.mp4 │ Java面试题06.装箱和拆箱.mp4 │ Java面试题07.==和equals的区别.mp4 │ Java面试题08.String.mp4 │ Java面试题09.讲一下java中的集合.mp4 │ Java面试题10.ArrayList ...