📄 resutil.java
字号:
package com.huawei.icd30.agt.util;
import com.huawei.icd30.common.db.SysResultSet;
import com.huawei.icd30.common.db.SysResultSetMetaData;
import java.sql.SQLException;
import java.util.Date;
/**
*
* <p> 主要处理结果是null情况,方便页面显示</p>
* <p>提供两个构造方法,默认是返回的空串,可以通过构造方法设置返回的具体形式</p>
* @author 高阳
* @version 1.0
*/
public class ResUtil implements SysResultSet
{
//对结果集得引用
SysResultSet res = null;
//返回的字符串
String returnStr = "" ;
/**
* @param res
*/
public ResUtil( SysResultSet res)
{
this.res = res;
}
/**
*
* @param res
* @param returnStr
*/
public ResUtil( SysResultSet res ,String returnStr)
{
this.res = res;
this.returnStr = returnStr;
}
/**
* override the getString method
* @param parm
* @return
* @throws java.sql.SQLException
*/
public String getString(int parm) throws java.sql.SQLException
{
return res.getString(parm) ==null?returnStr:res.getString(parm);
}
/**
* override the getString method
* @param parm
* @return
* @throws java.sql.SQLException
*/
public String getString(String parm) throws java.sql.SQLException
{
return res.getString(parm) ==null?returnStr:res.getString(parm);
}
/**
*
* @return
*/
public SysResultSetMetaData getMetaData()
{
return res.getMetaData();
}
/**
*
* @return
*/
public boolean prior()
{
return res.prior();
}
/**
*
* @return
*/
public boolean first()
{
return res.first();
}
/**
*
* @return
*/
public boolean bottom()
{
return res.bottom();
}
/**
*
* @param parm1
* @return
*/
public boolean setRecord(int parm1)
{
return res.setRecord(parm1);
}
/**
*
* @param parm1
* @return
* @throws java.sql.SQLException
*/
public boolean prior(int parm1) throws java.sql.SQLException
{
return res.prior(parm1);
}
/**
*
* @param parm1
* @return
* @throws java.sql.SQLException
*/
public boolean next(int parm1) throws java.sql.SQLException
{
return res.next(parm1);
}
/**
*
* @return
*/
public boolean next()
{
return res.next();
}
/**
*
* @param parm1
* @return
*/
public boolean getBoolean(int parm1) throws java.sql.SQLException
{
return res.getBoolean( parm1);
}
/**
*
* @param parm1
* @return
* @throws java.sql.SQLException
*/
public int getInt(int parm1) throws java.sql.SQLException
{
return res.getInt(parm1);
}
/**
*
* @param parm1
* @return
* @throws java.sql.SQLException
*/
public double getDouble(int parm1) throws java.sql.SQLException
{
return res.getDouble(parm1);
}
/**
*
* @param parm1
* @return
* @throws java.sql.SQLException
*/
public Date getDate(int parm1) throws java.sql.SQLException
{
return res.getDate(parm1);
}
/**
*
* @param parm1
* @return
* @throws java.sql.SQLException
*/
public byte[] getBytes(int parm1) throws java.sql.SQLException
{
return res.getBytes(parm1);
}
/**
*
* @param parm1
* @return
* @throws java.sql.SQLException
*/
public boolean getBoolean(String parm1) throws java.sql.SQLException
{
return res.getBoolean(parm1);
}
/**
*
* @param parm1
* @return
* @throws java.sql.SQLException
*/
public int getInt(String parm1) throws java.sql.SQLException
{
return res.getInt(parm1);
}
/**
*
* @param parm1
* @return
* @throws java.sql.SQLException
*/
public double getDouble(String parm1) throws java.sql.SQLException
{
return res.getDouble(parm1);
}
/**
*
* @param parm1
* @return
* @throws java.sql.SQLException
*/
public Date getDate(String parm1) throws java.sql.SQLException
{
return res.getDate(parm1);
}
/**
*
* @param parm1
* @return
* @throws java.sql.SQLException
*/
public byte[] getBytes(String parm1) throws java.sql.SQLException
{
return res.getBytes(parm1);
}
/**
*
* @param parm1
* @param parm2
*/
public void sort(int parm1, boolean parm2)
{
res.sort(parm1,parm2 );
}
/**
*
* @param parm1
* @param parm2
*/
public void sort(String parm1, boolean parm2)
{
res.sort(parm1,parm2 );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -