⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 examhighselectdao.java

📁 培训时做的学生管理系统.基于J2SE平台开发
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package cn.com.dao.chivementdao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;

import cn.com.util.DBConnection;
import cn.com.util.DBSql;
import cn.com.vo.chivementvo.ChivementVo;

public class ExamHighSelectDao {
	private Connection conn = DBConnection.getConnectionOracle();

	private ChivementVo examVo;

	public ExamHighSelectDao() {

	}

	public ExamHighSelectDao(ChivementVo examVo) {
		this.examVo = examVo;
	}
	
	
	
	
	
	
	public Object[][] select00011() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_00011);
			ps.setInt(1, examVo.getS_id());
			ps.setInt(2, examVo.getC_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {
					vo.add(rs.getObject(j + 1));
				}
				i++;
			}
			if(vo.size()>0){
				date = new Object[vo.size()/max][max];
				for(i=0;i<vo.size()/max;i++){
					for (int j = 0; j < max; j++) {
						date[i][j]=vo.get(k);
						k++;
					}
				}
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return date;
	}
	
	
	
	
	public Object[][] select00101() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_00101);
			ps.setInt(1, examVo.getG_id());
			ps.setInt(2, examVo.getC_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {
					vo.add(rs.getObject(j + 1));
				}
				i++;
			}
			if(vo.size()>0){
				date = new Object[vo.size()/max][max];
				for(i=0;i<vo.size()/max;i++){
					for (int j = 0; j < max; j++) {
						date[i][j]=vo.get(k);
						k++;
					}
				}
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return date;
	}
	
	
	
	
	public Object[][] select00110() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_00110);
			ps.setInt(1, examVo.getG_id());
			ps.setInt(2, examVo.getS_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {
					vo.add(rs.getObject(j + 1));
				}
				i++;
			}
			if(vo.size()>0){
				date = new Object[vo.size()/max][max];
				for(i=0;i<vo.size()/max;i++){
					for (int j = 0; j < max; j++) {
						date[i][j]=vo.get(k);
						k++;
					}
				}
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return date;
	}
	
	
	
	
	public Object[][] select00111() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_00111);
			ps.setInt(1, examVo.getG_id());
			ps.setInt(2, examVo.getS_id());
			ps.setInt(3, examVo.getC_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {
					vo.add(rs.getObject(j + 1));
				}
				i++;
			}
			if(vo.size()>0){
				date = new Object[vo.size()/max][max];
				for(i=0;i<vo.size()/max;i++){
					for (int j = 0; j < max; j++) {
						date[i][j]=vo.get(k);
						k++;
					}
				}
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return date;
	}
	
	
	
	
	public Object[][] select01001() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_01001);
			ps.setString(1, examVo.getS_name());
			ps.setString(2, "%" + examVo.getS_name() + "%");
			ps.setString(3, "%" + examVo.getS_name());
			ps.setString(4, examVo.getS_name() + "%");
			ps.setInt(5, examVo.getC_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {
					vo.add(rs.getObject(j + 1));
				}
				i++;
			}
			if(vo.size()>0){
				date = new Object[vo.size()/max][max];
				for(i=0;i<vo.size()/max;i++){
					for (int j = 0; j < max; j++) {
						date[i][j]=vo.get(k);
						k++;
					}
				}
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return date;
	}
	
	
	
	
	
	public Object[][] select01010() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_01010);
			ps.setString(1, examVo.getS_name());
			ps.setString(2, "%" + examVo.getS_name() + "%");
			ps.setString(3, "%" + examVo.getS_name());
			ps.setString(4, examVo.getS_name() + "%");
			ps.setInt(5, examVo.getS_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {
					vo.add(rs.getObject(j + 1));
				}
				i++;
			}
			if(vo.size()>0){
				date = new Object[vo.size()/max][max];
				for(i=0;i<vo.size()/max;i++){
					for (int j = 0; j < max; j++) {
						date[i][j]=vo.get(k);
						k++;
					}
				}
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return date;
	}
	
	
	
	
	
	public Object[][] select01011() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_01011);
			ps.setString(1, examVo.getS_name());
			ps.setString(2, "%" + examVo.getS_name() + "%");
			ps.setString(3, "%" + examVo.getS_name());
			ps.setString(4, examVo.getS_name() + "%");
			ps.setInt(5, examVo.getS_id());
			ps.setInt(6, examVo.getC_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {
					vo.add(rs.getObject(j + 1));
				}
				i++;
			}
			if(vo.size()>0){
				date = new Object[vo.size()/max][max];
				for(i=0;i<vo.size()/max;i++){
					for (int j = 0; j < max; j++) {
						date[i][j]=vo.get(k);
						k++;
					}
				}
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return date;
	}
	
	
	
	
	public Object[][] select01100() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_01100);
			ps.setString(1, examVo.getS_name());
			ps.setString(2, "%" + examVo.getS_name() + "%");
			ps.setString(3, "%" + examVo.getS_name());
			ps.setString(4, examVo.getS_name() + "%");
			ps.setInt(5, examVo.getG_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {
					vo.add(rs.getObject(j + 1));
				}
				i++;
			}
			if(vo.size()>0){
				date = new Object[vo.size()/max][max];
				for(i=0;i<vo.size()/max;i++){
					for (int j = 0; j < max; j++) {
						date[i][j]=vo.get(k);
						k++;
					}
				}
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return date;
	}
	public Object[][] select01101() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_01101);
			ps.setString(1, examVo.getS_name());
			ps.setString(2, "%" + examVo.getS_name() + "%");
			ps.setString(3, "%" + examVo.getS_name());
			ps.setString(4, examVo.getS_name() + "%");
			ps.setInt(5, examVo.getG_id());
			ps.setInt(6, examVo.getC_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {
					vo.add(rs.getObject(j + 1));
				}
				i++;
			}
			if(vo.size()>0){
				date = new Object[vo.size()/max][max];
				for(i=0;i<vo.size()/max;i++){
					for (int j = 0; j < max; j++) {
						date[i][j]=vo.get(k);
						k++;
					}
				}
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return date;
	}
	
	
	
	
	
	public Object[][] select01110() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_01110);
			ps.setString(1, examVo.getS_name());
			ps.setString(2, "%" + examVo.getS_name() + "%");
			ps.setString(3, "%" + examVo.getS_name());
			ps.setString(4, examVo.getS_name() + "%");
			ps.setInt(5, examVo.getG_id());
			ps.setInt(6, examVo.getS_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {
					vo.add(rs.getObject(j + 1));
				}
				i++;
			}
			if(vo.size()>0){
				date = new Object[vo.size()/max][max];
				for(i=0;i<vo.size()/max;i++){
					for (int j = 0; j < max; j++) {
						date[i][j]=vo.get(k);
						k++;
					}
				}
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return date;
	}
	
	
	
	
	public Object[][] select01111() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_01111);
			ps.setString(1, examVo.getS_name());
			ps.setString(2, "%" + examVo.getS_name() + "%");
			ps.setString(3, "%" + examVo.getS_name());
			ps.setString(4, examVo.getS_name() + "%");
			ps.setInt(5, examVo.getG_id());
			ps.setInt(6, examVo.getS_id());
			ps.setInt(7, examVo.getC_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {
					vo.add(rs.getObject(j + 1));
				}
				i++;
			}
			if(vo.size()>0){
				date = new Object[vo.size()/max][max];
				for(i=0;i<vo.size()/max;i++){
					for (int j = 0; j < max; j++) {
						date[i][j]=vo.get(k);
						k++;
					}
				}
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return date;
	}
	
	
	
	
	
	public Object[][] select10001() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_10001);
			ps.setString(1, examVo.getClass_name());
			ps.setString(2, "%" + examVo.getClass_name() + "%");
			ps.setString(3, "%" + examVo.getClass_name());
			ps.setString(4, examVo.getClass_name() + "%");
			ps.setInt(5, examVo.getC_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {
					vo.add(rs.getObject(j + 1));
				}
				i++;
			}
			if(vo.size()>0){
				date = new Object[vo.size()/max][max];
				for(i=0;i<vo.size()/max;i++){
					for (int j = 0; j < max; j++) {
						date[i][j]=vo.get(k);
						k++;
					}
				}
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return date;
	}
	
	
	
	

	
	
	public Object[][] select10010() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_10010);
			ps.setString(1, examVo.getClass_name());
			ps.setString(2, "%" + examVo.getClass_name() + "%");
			ps.setString(3, "%" + examVo.getClass_name());
			ps.setString(4, examVo.getClass_name() + "%");
			ps.setInt(5, examVo.getS_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {
					vo.add(rs.getObject(j + 1));
				}
				i++;
			}
			if(vo.size()>0){
				date = new Object[vo.size()/max][max];
				for(i=0;i<vo.size()/max;i++){
					for (int j = 0; j < max; j++) {
						date[i][j]=vo.get(k);
						k++;
					}
				}
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return date;
	}
	
	
	
	
	
	
	
	public Object[][] select10011() {
		Object date[][] = null;
		int max = 0;
		int i = 0;
		PreparedStatement ps = null;
		ResultSet rs = null;
		try {
			ps = conn.prepareStatement(DBSql.SELECT_10011);
			ps.setString(1, examVo.getClass_name());
			ps.setString(2, "%" + examVo.getClass_name() + "%");
			ps.setString(3, "%" + examVo.getClass_name());
			ps.setString(4, examVo.getClass_name() + "%");
			ps.setInt(5, examVo.getS_id());
			ps.setInt(6, examVo.getC_id());
			rs = ps.executeQuery();
			max = rs.getMetaData().getColumnCount();
			int k = 0;
			Vector vo = new Vector();
			while (rs.next()) {
				for (int j = 0; j < max; j++) {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -