• 大小: 4.92MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-23
  • 语言: Java
  • 标签: mvc框架  demo  

资源简介

java_web项目mvc框架demo;java_web项目mvc框架demo;java_web项目mvc框架demo

资源截图

代码片段和文件信息

package javabean;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import odbc.Dbutil;
public class AddBook {

public boolean check(String booknameString authorString publisherString dateString imageString infoString priceString fro) throws Exception
{
Connection con=Dbutil.connectToDb(“book“);
Statement stmt=null; 
String name =new String(bookname.getBytes(“ISO-8859-1“)); 
author =new String(author.getBytes(“ISO-8859-1“)); 
publisher =new String(publisher.getBytes(“ISO-8859-1“)); 
date =new String(date.getBytes(“ISO-8859-1“)); 
image =new String(image.getBytes(“ISO-8859-1“)); 
info =new String(info.getBytes(“ISO-8859-1“)); 
price =new String(price.getBytes(“ISO-8859-1“)); 
fro =new String(fro.getBytes(“ISO-8859-1“)); 
//System.out.print(name);
//System.out.print(author);
//System.out.print(publisher);
//System.out.print(date);
//System.out.print(image);
//System.out.print(info);
//System.out.print(price);
//System.out.print(fro); 
int position=image.lastIndexOf(‘\\‘);
String pimage=image.substring(position+1image.length());
pimage =new String(pimage.getBytes(“ISO-8859-1“)); 
try{
String sql=“insert into books(booknameauthorpublisherpdatepriceimageinfofro) values(‘“+name+“‘‘“+author+“‘‘“+publisher+“‘‘“+date+“‘‘“+price+“‘‘“+pimage+“‘‘“+info+“‘‘“+fro+“‘)“;
stmt=con.createStatement();
int i=stmt.executeUpdate(sql);
if(i!=0)  
return true;
}
catch(Exception ex){
ex.printStackTrace();
}
finally{
try{
stmt.close();
con.close();
}catch(Exception e){ e.printStackTrace();}
}
return false;
}
public static void main(String[] args) {
// TODO Auto-generated method stub

}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-07-05 07:28  book\
     文件         842  2017-06-20 08:24  book\.classpath
     文件         904  2017-06-20 08:24  book\.project
     目录           0  2017-07-05 07:28  book\.settings\
     文件         567  2017-06-20 08:24  book\.settings\.jsdtscope
     文件         364  2017-06-20 08:24  book\.settings\org.eclipse.jdt.core.prefs
     文件         464  2017-06-20 08:24  book\.settings\org.eclipse.wst.common.component
     文件         345  2017-06-20 08:24  book\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2017-06-20 08:24  book\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2017-06-20 08:24  book\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2017-07-05 07:28  book\build\
     目录           0  2017-07-05 07:28  book\build\classes\
     目录           0  2017-07-05 07:28  book\build\classes\javabean\
     文件        2715  2017-06-23 08:51  book\build\classes\javabean\AddBook.class
     文件        1818  2017-06-23 08:51  book\build\classes\javabean\Book.class
     文件        1738  2017-06-23 08:51  book\build\classes\javabean\DelBook.class
     文件        1996  2017-06-23 08:51  book\build\classes\javabean\DelUser.class
     文件        2082  2017-06-23 08:51  book\build\classes\javabean\Login.class
     文件        2743  2017-06-23 08:51  book\build\classes\javabean\ModifyBook.class
     文件        2008  2017-06-23 08:51  book\build\classes\javabean\ModifyUser.class
     文件        3688  2017-06-23 08:51  book\build\classes\javabean\ReadBook.class
     文件        2567  2017-06-23 08:51  book\build\classes\javabean\ReadUser.class
     文件        3077  2017-06-23 08:51  book\build\classes\javabean\Reg.class
     文件         887  2017-06-23 08:51  book\build\classes\javabean\User.class
     目录           0  2017-07-05 07:28  book\build\classes\odbc\
     文件        1504  2017-06-23 09:02  book\build\classes\odbc\Dbutil.class
     目录           0  2017-07-05 07:28  book\build\classes\servlet\
     文件        2958  2017-06-23 08:51  book\build\classes\servlet\AddBookServlet.class
     文件        2547  2017-06-23 08:51  book\build\classes\servlet\DelBookServlet.class
     文件        2900  2017-06-23 08:51  book\build\classes\servlet\DelUserServlet.class
     文件        2398  2017-06-23 08:51  book\build\classes\servlet\LoginOutServlet.class
............此处省略75个文件信息

评论

共有 条评论