- 浏览: 52549 次
最新评论
文章列表
jstl c标签库的使用
- 博客分类:
- web技术
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://" ...
//线程下载类
package com.cgm.mutithreaddowm;
import java.io.File;
import java.io.RandomAccessFile;
import java.net.HttpURLConnection;
import java.net.URL;
public class MutiThreadDowm {
public MutiThreadDowm() throws Exception{
String path="http://localhost:8080/test/up/11.txt ...
HttpURLConnection实现断点下载
- 博客分类:
- web技术
package cn.demo;
import java.io.File;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.net.HttpURLConnection;
import java.net.URL;
public class BreakDown {
public static void main(String[] args) throws Exception {
String fileName = "video.avi";
String path = & ...
package cn.demo;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.net.HttpURLConnection;
import java.net.URL;
public class CommonDown {
public static void main(String[] args) throws Exception {
String path = "ht ...
servlet...code
package cn.itcast;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class OneServlet extends Htt ...
servle+jspt文件下载
- 博客分类:
- web技术
jsp code
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
< ...
web 最简单的jsp下载
- 博客分类:
- web技术
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+requ ...
分布式数据库用触发器实现数据同步
- 博客分类:
- oracle知识
分布式数据库
三种 1.本地 开sqlplus scott/tiger
2.远程 开sqlplus scott/tiger@192.168.1.217、orcl
3.分布式
1.oracle配置工具
net manager -----> 点击+---->
输入服务器名 随便输啊--->
点击下一步--->主机名就是远程的IP地址---->保存
2.创建数据库链路
...
oracle存储过程在项目中的运用
- 博客分类:
- oracle存储过程
create or replace procedure PRC_MAIL_FULL_DLV_SAMPLE IS
reportStatDate varchar(8);
sqlText varchar(2000);
v_etl_temp_time date;
cursor p_cursor is select sa.mail_num,
sa.last_query_time, ...
/*
查询某个员工的年收入
CREATE [OR REPLACE] FUNCTION 函数名(参数列表)
RETURN 函数值类型
AS
PLSQL子程序体;
*/
create or replace function queryEmpIncome(eno in number)
return number
as
--变量
psal emp.sal%type;
pcomm emp.comm%type;
begin
select sal,comm into psal,pcomm from emp where empno=eno;
return psal*12+nvl(p ...
/*
实施复杂的安全性检查
限制非工作时间向数据库插入(emp)数据:
周末: to_char(sysdate,'day') in ('星期六','星期日')
上班前,下班后:to_number(to_char(sysdate,'hh24')) not between 9 and 18
*/
create or replace trigger securityEmp
before insert
on emp
begin
if to_char(sysdate,'day') in ('星期六','星期日','星期三') or
to_number(to_char(sysdate,' ...
确认数据(涨后的薪水不能少于涨前的薪水
- 博客分类:
- oracle触发器
/*
确认数据(涨后的薪水不能少于涨前的薪水)
*/
create or replace trigger checksal
before update
on emp
for each row
begin
if :new.sal < : old.sal then
raise_application_error(-20001,'涨后的薪水不能少于涨前的薪水.涨前:'||:old.sal||' 涨后:'||:new.sal);
end if;
end;
/*
为员工长工资。从最低工资调起每人长10%,但工资总额不能超过5万元,
请计算长工资的人数和长工资后的工资总额,并输出输出长工资人数及工资总额。
可能的SQL:
员工: select empno,sal from emp order by sal;
长工资后的工资总额:1. 对sal进行累加: 新的工资总额=旧的工资 + sal*0.1;
2. sum(sal): 查询数据库
练习: 工资不能超过5w
*/
declare
--员工
cursor cemp is select empno,sal from emp order by sal;
...
查询某个部门中所有员工的所有信息
CREATE OR REPLACE
PACKAGE MYPACKAGE AS
type empcursor is ref cursor;
procedure queryEmpList(dno in number,empList out empcursor);
END MYPACKAGE;
==============================================
CREATE OR REPLACE
PACKAGE BODY MYPACKAGE AS
procedure queryEmpList(dno in numb ...
/*
查询某个员工的姓名 月薪 职位
*/
create or replace procedure queryEmpInfo(eno in number,
pename out varchar2,
psal out number,
pjob out varchar2)
as
begin
select ename,sal,empjob int ...