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

📄 chargedao.java

📁 新东方软件开发项目
💻 JAVA
字号:
package com.mobile.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.mobile.bean.TAccount;
import com.mobile.bean.TCharge;
import com.mobile.bean.TCharge_Rule;


public class ChargeDAO {

 
	public String check_func_id(String name){
		
		int ret = 0;
		Connection con=null;
		ResultSet rs=null;
		String id=null;
	
			try {
				con=ConnectionMgr.getConnection();
				PreparedStatement pstmt =con.prepareStatement("select * from  TCharge_Rule where Func_Name="+name);
				rs=pstmt.executeQuery();
				while(rs.next()){
					id=rs.getString(1);
				}
				
				
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return id;
			
			
	}
	
	
	
	public int insertCharge(TCharge tc) 
	{
		int ret = 0;
		Connection con=null;
		try {
			con=ConnectionMgr.getConnection();
			PreparedStatement pstmt =con.prepareStatement("insert into TCharge values(?,?,?)");
			
			pstmt.setString(1, Character.toString(tc.getChargeCode()));
			pstmt.setString(2, tc.getChargeName());
			pstmt.setString(3, tc.getCharge());
			ret = pstmt.executeUpdate();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
 System.out.println(ret);
	 
		
		return ret;
	}
	
	public int insertCharge_Rule(TCharge_Rule tc) 
	{
		int ret = 0;
		Connection con=null;
		try {
			con=ConnectionMgr.getConnection();
			PreparedStatement pstmt =con.prepareStatement("insert into TCharge_Rule values(?,?,?)");
			
			pstmt.setString(1, (tc.getFunc_ID()));
			pstmt.setString(2, tc.getCharge_Code());
			pstmt.setString(3, tc.getFunc_Name());
			ret = pstmt.executeUpdate();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
 System.out.println(ret);
	 
		
		return ret;
	}



}

⌨️ 快捷键说明

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