inittypes.java

来自「改代码是采用JSP实现的在线办公自动化管理系统」· Java 代码 · 共 54 行

JAVA
54
字号
package swing;

import com.bwm.string.Str;
import com.zh.conpool.*;
import java.sql.Connection;

public class Inittypes{
	
	private String name="";
	private String sql="";
	private int aa=0;
	
	Str str=new Str();
	Condata con=new Condata();
	Connection conn=null;
	
	public void setName(String newnames){
		this.name=newnames;
	}
	
	public int toRs(){
		sql="insert into tb_th_types(Types) values('"+name+"')";
		try{
			con.getConnection();
			aa=con.executeUpdate(sql);
		}catch(Exception eee){
			aa=0;
		}
		return aa;
	}
	public int toRsa(){
		sql="insert into tb_th_unit(Units) values('"+name+"')";
		try{
			con.getConnection();
			aa=con.executeUpdate(sql);
		}catch(Exception eee){
			aa=0;
		}
		return aa;
	}
	public void close(){
		try{
			conn=null;
		}catch(Exception e){
			System.out.print("f1");
		}
		try{
			con.close();
			con=null;
		}catch(Exception ee){
			System.out.print("f");
		}
	}
}

⌨️ 快捷键说明

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