您的位置:首页 > 数据库 > Oracle

ONGL 在jsp 页面得到后台传过来的对象值, DAO层得到Oracle序列

2010-06-03 21:42 441 查看
ONGL 在jsp 页面得到后台传过来的对象值 文章分类:Web前端 1、在jsp页面引入包

Html代码



<%@ page import="com.opensymphony.xwork.util.OgnlValueStack"%>
<%@ page import="com.opensymphony.xwork.util.OgnlValueStack"%>


2、得到值

Java代码



OgnlValueStack ov = (OgnlValueStack) request.getAttribute("webwork.valueStack");  

String url = (String) ov.findValue("groupId");  

out.println(url); 

 

 

DAO层得到Oracle序列
文章分类:数据库

1、先定义Spring jdbc 变量

Java代码



// 序列

private DataFieldMaxValueIncrementer defectInfoCommonSeq; 

// 序列
private DataFieldMaxValueIncrementer defectInfoCommonSeq;


2、DAO初始化时

Java代码



@Override

protected void initDao() throws Exception {  

    defectInfoCommonSeq = new OracleSequenceMaxValueIncrementer(super

    .getDataSource(), "PW_DEFECT_INFO_COMMON_SEQ");   

//  super.getDataSource() 因为这里即成了基类,得到数据源



@Override
protected void initDao() throws Exception {
defectInfoCommonSeq = new OracleSequenceMaxValueIncrementer(super
.getDataSource(), "PW_DEFECT_INFO_COMMON_SEQ");
//  super.getDataSource() 因为这里即成了基类,得到数据源
}


3、SETTER方法

Java代码



@Override

protected String getCommonSequenceName() {  

return "PW_DEFECT_INFO_COMMON_SEQ" ;  

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐