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

📄 inse.java

📁 一个水气收费系统 具有 删除 查询等功能
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.* ;
import java.sql.* ;
import java.lang.Object ;

public class inse
{
	Integer userid ;
	Integer waterprice ;
	Integer gasprice ;
	Integer watermoney ;
	Integer gasmoney ;
	Integer zong ;
	 
	Integer water ;
	Integer gas ;
	
	String name ;
	String address ;
	PreparedStatement prepStmt = null ;
	ResultSet rsd = null ;
	public inse(Integer userid,String name,String address)
	{
		try
		{
		
	  Timestamp  ti = new Timestamp(System.currentTimeMillis()) ;
	
		conn conn = new conn("wanglei","wanglei") ;
	
		prepStmt = conn.conn.prepareStatement("insert into users values(?,?,?,?)") ;
		
		prepStmt.setInt(1,userid) ;
		prepStmt.setString(2,name) ;
		prepStmt.setString(3,address) ;
		prepStmt.setTimestamp(4,ti) ;
		
	    rsd = prepStmt.executeQuery() ;
	   }
	   catch(Exception e)
	   {            JOptionPane.showMessageDialog(new JFrame(), "Wrong users", "Dialog", 
                          JOptionPane.ERROR_MESSAGE); 
	   }
	}
	
	public inse(Integer waterpi,Integer gaspi)
	{
		try
		{
		
	Timestamp	ti = new Timestamp(System.currentTimeMillis()) ;
		
		conn conn = new conn("wanglei","wanglei") ;
		
		prepStmt = conn.conn.prepareStatement("insert into price values(?,?,?)") ;
		
		prepStmt.setInt(1,waterpi) ;
		prepStmt.setInt(2,gaspi) ;
		prepStmt.setTimestamp(3,ti) ;
	    rsd = prepStmt.executeQuery() ;
	   }
	   catch(Exception ex)
	   { JOptionPane.showMessageDialog(new JFrame(), "Wrong insert price", "Dialog", 
                          JOptionPane.ERROR_MESSAGE); 
	   }
	}
	
	public inse(Integer userid,Integer water,Integer gas,Integer watermoney,Integer gasmoney,Integer zong)
	{
	  try
	  {
	  
	 Timestamp  ti = new Timestamp(System.currentTimeMillis()) ;
		
		conn conn = new conn("wanglei","wanglei") ;
		
		prepStmt = conn.conn.prepareStatement("insert into da values(?,?,?,?,?,?,?)") ;
		
		prepStmt.setInt(1,userid) ;
		prepStmt.setInt(2,water) ;
		prepStmt.setInt(3,gas) ;
		prepStmt.setInt(4,watermoney) ;
		prepStmt.setInt(5,gasmoney) ;
		prepStmt.setInt(6,zong) ;
		prepStmt.setTimestamp(7,ti) ;
		rsd = prepStmt.executeQuery() ;
	   }
	   catch(Exception ec)
	   {                  JOptionPane.showMessageDialog(new JFrame(), "Wrong insert da", "Dialog", 
                          JOptionPane.ERROR_MESSAGE); 
	   }	
	}
	
	 
}//inse

⌨️ 快捷键说明

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