完整word版蓝宇快递打印系统.docx
- 文档编号:1421943
- 上传时间:2022-10-22
- 格式:DOCX
- 页数:102
- 大小:1.49MB
完整word版蓝宇快递打印系统.docx
《完整word版蓝宇快递打印系统.docx》由会员分享,可在线阅读,更多相关《完整word版蓝宇快递打印系统.docx(102页珍藏版)》请在冰豆网上搜索。
完整word版蓝宇快递打印系统
实验十三综合案例
1.实验目的:
通过综合系统的练习,我们可以对我们所学的知识进行系统的复习
2.实验题目:
做一个蓝宇快递系统
3.实验代码
packagecom.zzk.bean;
publicclassExpressMessage{
privateintid=0;
privateStringsendName=null;
privateStringsendTelephone=null;
privateStringsendCompary=null;
privateStringsendAddress=null;
privateStringsendPostcode=null;
privateStringreceiveName=null;
privateStringreceiveTelephone=null;
privateStringreceiveCompary=null;
privateStringreceiveAddress=null;
privateStringreceivePostcode=null;
privateStringControlPosition=null;//快递单上添加信息的组件位置(坐标)
privateStringexpressSize=null;//快递单的尺寸(大小)
publicintgetId(){
returnid;
}
publicvoidsetId(intid){
this.id=id;
}
publicStringgetSendName(){
returnsendName;
}
publicvoidsetSendName(StringsendName){
this.sendName=sendName;
}
publicStringgetSendTelephone(){
returnsendTelephone;
}
publicvoidsetSendTelephone(StringsendTelephone){
this.sendTelephone=sendTelephone;
}
publicStringgetSendCompary(){
returnsendCompary;
}
publicvoidsetSendCompary(StringsendCompary){
this.sendCompary=sendCompary;
}
publicStringgetSendAddress(){
returnsendAddress;
}
publicvoidsetSendAddress(StringsendAddress){
this.sendAddress=sendAddress;
}
publicStringgetSendPostcode(){
returnsendPostcode;
}
publicvoidsetSendPostcode(StringsendPostcode){
this.sendPostcode=sendPostcode;
}
publicStringgetReceiveName(){
returnreceiveName;
}
publicvoidsetReceiveName(StringreceiveName){
this.receiveName=receiveName;
}
publicStringgetReceiveTelephone(){
returnreceiveTelephone;
}
publicvoidsetReceiveTelephone(StringrecieveTelephone){
this.receiveTelephone=recieveTelephone;
}
publicStringgetReceiveCompary(){
returnreceiveCompary;
}
publicvoidsetReceiveCompary(StringrecieveCompary){
this.receiveCompary=recieveCompary;
}
publicStringgetReceiveAddress(){
returnreceiveAddress;
}
publicvoidsetReceiveAddress(StringreceiveAddress){
this.receiveAddress=receiveAddress;
}
publicStringgetReceivePostcode(){
returnreceivePostcode;
}
publicvoidsetReceivePostcode(StringreceivePostcode){
this.receivePostcode=receivePostcode;
}
publicStringgetControlPosition(){
returnControlPosition;
}
publicvoidsetControlPosition(StringcontrolPosition){
ControlPosition=controlPosition;
}
publicStringgetExpressSize(){
returnexpressSize;
}
publicvoidsetExpressSize(StringexpressSize){
this.expressSize=expressSize;
}
}
packagecom.zzk.bean;
publicclassUser{
privateStringname=null;
privateStringpwd=null;
privateStringokPwd=null;
publicStringgetName(){
returnname;
}
publicvoidsetName(Stringname){
this.name=name;
}
publicStringgetPwd(){
returnpwd;
}
publicvoidsetPwd(Stringpwd){
this.pwd=pwd;
}
publicvoidsetOkPwd(StringokPwd){
this.okPwd=okPwd;
}
publicStringgetOkPwd(){
returnokPwd;
}
}
packagecom.zzk.dao;
importjava.sql.Connection;
importjava.sql.DriverManager;
importjavax.swing.JOptionPane;
publicclassDAO{
privatestaticDAOdao=newDAO();//声明DAO类的静态实例
/**
*构造方法,加载数据库驱动
*/
publicDAO(){
try{
Class.forName("net.sourceforge.jtds.jdbc.Driver");//加载数据库驱动
}catch(ClassNotFoundExceptione){
JOptionPane.showMessageDialog(null,"数据库驱动加载失败,请将JTDS驱动配置到构建路径中。
\n"+e.getMessage());
}
}
/**
*获得数据库连接的方法
*
*@returnConnection
*/
publicstaticConnectiongetConn(){
try{
Connectionconn=null;//定义数据库连接
Stringurl="jdbc:
jtds:
sqlserver:
//localhost:
1433/db_ExpressPrint";//数据库db_Express的URL
Stringusername="sa";//数据库的用户名
Stringpassword="";//数据库密码
conn=DriverManager.getConnection(url,username,password);//建立连接
returnconn;//返回连接
}catch(Exceptione){
JOptionPane.showMessageDialog(null,"数据库连接失败。
\n请检查数据库用户名和密码是否正确。
"+e.getMessage());
returnnull;
}
}
}
packagecom.zzk.dao;
importjava.sql.Connection;
importjava.sql.PreparedStatement;
importjava.sql.ResultSet;
importjava.sql.SQLException;
importjava.util.Vector;
importjavax.swing.JOptionPane;
importcom.zzk.bean.ExpressMessage;
publicclassExpressMessageDao{
publicstaticvoidinsertExpress(ExpressMessagem){
if(m.getSendName()==null||m.getSendName().trim().equals("")){
JOptionPane.showMessageDialog(null,"寄件人信息必须填写。
");
return;
}
if(m.getSendTelephone()==null||m.getSendTelephone().trim().equals("")){
JOptionPane.showMessageDialog(null,"寄件人信息必须填写。
");
return;
}
if(m.getSendCompary()==null||m.getSendCompary().trim().equals("")){
JOptionPane.showMessageDialog(null,"寄件人信息必须填写。
");
return;
}
if(m.getSendAddress()==nul
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 完整 word 版蓝宇 快递 打印 系统