📄 mpbean.java
字号:
package com;
import java.sql.*;
import com.userbean;
public class mpbean
{
Statement stmt;
int num=1;
static String code="a";
static String arrive_time="1";
static String arrive_byway="1";
static String leave_time="1";
static String leave_byway="1";
static String destination="1";
static String sql;
public void setNum(int n)
{
num=n;
}
public int getNum()
{
return num;
}
public void setCode(String c)
{
code=c;
}
public String getCode()
{
return code;
}
public void setArrive_time(String c)
{
arrive_time=c;
}
public String getArrive_time()
{
return arrive_time;
}
public void setArrive_byway(String c)
{
arrive_byway=c;
}
public String getArrive_byway()
{
return arrive_byway;
}public void setLeave_time(String c)
{
leave_time=c;
}
public String getLeave_time()
{
return leave_time;
}
public void setLeave_byway(String c)
{
leave_byway=c;
}
public String getLeave_byway()
{
return leave_byway;
}
public void setDestination(String c)
{
destination=c;
}
public String getDestination()
{
return destination;
}
public void insertmp()throws SQLException
{
userbean u=new userbean();
u.getRecord();
stmt=u.getCon().createStatement();
sql="insert into meetingperson values('"+num+"','"+code+"','"+arrive_time+"','"
+arrive_byway+"','"+leave_time+"','"+leave_byway+"','"+destination+"')";
stmt.executeUpdate(sql);
}
public void delete()throws SQLException
{
userbean u=new userbean();
u.getRecord();
sql="delete meetingperson where num="+num+"and code='"+code+"'";
stmt=u.getCon().createStatement();
stmt.executeUpdate(sql);
}
public void selectmp()throws SQLException
{
userbean u=new userbean();
u.getRecord();
sql="select * from meetingperson where num="+num+"and code='"+code+"'";
stmt=u.getCon().createStatement();
ResultSet rs=stmt.executeQuery(sql);
while(rs.next())
{
arrive_time=rs.getString("arrive_time");
arrive_byway=rs.getString("arrive_byway");
leave_time=rs.getString("leave_time");
leave_byway=rs.getString("leave_byway");
destination=rs.getString("destination");
}
}
/*public static void main(String args[])throws SQLException
{
mpbean m=new mpbean() ;
m.selectmp();
System.out.println(arrive_time);
System.out.println(arrive_byway);
System.out.println(leave_time);
System.out.println(leave_byway);
System.out.println(destination);
}*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -