?? articlemanage.java
字號:
package com.v246;
public class ArticleManage
{
protected static PageableResultSet page=new PageableResultSet();
public static String getParentName(String column)throws Exception
{
String re=null;
java.sql.ResultSet rs=null;
java.sql.Connection conn=null;
java.sql.Statement stm=null;
Connections connTmp=new Connections();
try
{
conn=connTmp.getConnection();
stm=conn.createStatement();
}
catch(Exception e)
{
e.printStackTrace();
}
try
{
rs=stm.executeQuery("select * from "+column);
if(rs.next())
{
re=rs.getString("Title");
}
}
catch(Exception e)
{
e.printStackTrace();
}
return re;
}
public static void initArticleManage(String column) throws Exception
{
java.sql.ResultSet rs=null;
java.sql.Connection conn=null;
java.sql.Statement stm=null;
Connections connTmp=new Connections();
try
{
conn=connTmp.getConnection();
stm=conn.createStatement(java.sql.ResultSet.TYPE_SCROLL_SENSITIVE,java.sql.ResultSet.CONCUR_UPDATABLE);
}
catch(Exception e)
{
e.printStackTrace();
}
try
{
rs=stm.executeQuery("select * from "+column);
}
catch(Exception e)
{
e.printStackTrace();
}
try
{
//if(this.rs!=null) this.rs.close();
page.pageableResultSet(rs);
}
catch(Exception e)
{
e.printStackTrace();
}
finally
{
//if(rs!=null) rs.close();
//if(stm!=null) stm.close();
//if(conn!=null) conn.close();
}
}
public static String next() throws Exception
{
return String.valueOf(page.next());
}
public static String getCurPage() //返回當前頁號
{
return String.valueOf(page.getCurPage());
}
public static String getPageCount() //返回總頁數
{
return String.valueOf(page.getPageCount());
}
public static String getPageSize() //返回分頁大小
{
return String.valueOf(page.getPageSize());
}
public static String getRowsCount() //返回總記錄行數
{
return String.valueOf(page.getRowsCount());
}
public static void gotoPage(String pages) //轉到指定頁
{
page.gotoPage(Integer.parseInt(pages));
}
public static void setPageSize(int pageSize) //設置分頁大小
{
page.setPageSize(pageSize);
}
public static String getString(String column)throws Exception
{
return page.getString(column);
}
public static String getInt(String column)throws Exception
{
return page.getInt(column);
}
public static String getBoolean(String column)throws Exception
{
return page.getBoolean(column);
}
public static void pageFirst() throws java.sql.SQLException //轉到當前頁的第一條記錄
{
page.pageFirst();
}
public static void pageLast() throws java.sql.SQLException //轉到當前頁的最后一條記錄
{
page.pageLast();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -