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

📄 mddcustom.java

📁 本系统特色: 1、前台完全生成静态HTML 2、栏目是无级分类的
💻 JAVA
字号:
package com.v246;
public class MDDCustom
{
	private static java.sql.Connection conn=null;
	private static java.sql.Statement stm=null;
	private static java.sql.ResultSet rs=null;
	private static Connections connTmp=new Connections();
	public static void initMDDCustom()
	{
		try
		{
			conn=connTmp.getConnection();
			stm=conn.createStatement();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		try
		{
			rs=stm.executeQuery("select * from customLable");
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}
	public static boolean next()throws Exception
	{
		try
		{
			return rs.next();
		}
		catch(Exception e)
		{
			throw new Exception("Error in MDDCustom.java NO.1 "+e.getMessage());
		}
	}
	public static String getString(String s)throws Exception
	{
		try
		{
			return rs.getString(s);
		}
		catch(Exception e)
		{
			throw new Exception("Error in MDDCustom.java NO.2 "+e.getMessage());
		}
	}
	public static int getInt(String s)throws Exception
	{
		try
		{
			return rs.getInt(s);
		}
		catch(Exception e)
		{
			throw new Exception("Error in MDDCustom.java NO.3 "+e.getMessage());
		}
	}
	public static boolean getBoolean(String s)throws Exception
	{
		try
		{
			return rs.getBoolean(s);
		}
		catch(Exception e)
		{
			throw new Exception("Error in MDDCustom.java NO.4 "+e.getMessage());
		}
	}
	public static int getCount()throws Exception
	{
		int re;
		try
		{
			rs.last();
			re=rs.getRow();
			rs.beforeFirst();
		}
		catch(Exception e)
		{
			throw new Exception("Error in MDDCustom.java NO.5 "+e.getMessage());
		}
		return re;
	}
	public static void deleteCustom(String id)throws Exception
	{
		try
		{
			stm.executeUpdate("delete from customlable where id="+id);
		}
		catch(Exception e)
		{
			throw new Exception("Error in MDDCustom.java NO.6 "+e.getMessage());
		}
		
	}
	public static void customModify(String id)
	{
		try
		{
			conn=connTmp.getConnection();
			stm=conn.createStatement();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		try
		{
			rs=stm.executeQuery("select * from customLable where id="+id);
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}
	public static void close()throws Exception
	{
		try
		{
			if(rs!=null)rs.close();
			if(stm!=null)stm.close();
			if(conn!=null)conn.close();
		}
		catch(Exception e)
		{
			throw new Exception("Error in MDDCustom.java NO.7 "+e.getMessage());
		}
		finally
		{
			if(rs!=null)rs.close();
			if(stm!=null)stm.close();
			if(conn!=null)conn.close();
		}
	}
	public static String subLable(String s)
	{
		return s.substring(2,s.length()-2);
	}
}

⌨️ 快捷键说明

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