资源简介
jsp+mysql网上商城、jsp+mysql网上商城、jsp+mysql网上商城、
代码片段和文件信息
package ckstudio.db;
import java.sql.*;
public class mysqlconn {
String sDBDriver = “com.mysql.jdbc.Driver“;
//请修改下面参数--数据地址:localhost 数据库名:jspshop 用户名:root 密码:
String sConnStr = “jdbc:mysql://localhost:3306/jspshop“;
Connection conn = null;
ResultSet rs = null;
public mysqlconn() {
try {
Class.forName(sDBDriver);
}
catch(java.lang.ClassNotFoundException e) {
System.err.println(“conn(): “ + e.getMessage());
}
}
public void executeInsert(String sql)
{
try
{
conn=DriverManager.getConnection(sConnStr“root““123“);
Statement stmt=conn.createStatement();
int n=stmt.executeUpdate(sql);
}
catch(SQLException ex)
{
System.err.println(“conn.executeUpdate:“+ ex.getMessage());
}
}
public ResultSet executeQuery(String sql) {
rs = null;
try {
conn = DriverManager.getConnection(sConnStr“root““123“);
Statement stmt;
stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVEResultSet.CONCUR_UPDATABLE);
rs = stmt.executeQuery(sql);
}
catch(SQLException ex) {
System.err.println(“conn.executeQuery: “ + ex.getMessage());
}
return rs;
}
public void executeDelete(String sql)
{
try
{
conn=DriverManager.getConnection(sConnStr);
Statement stmt=conn.createStatement();
stmt.executeUpdate(sql);
}
catch(SQLException ex)
{
System.err.println(“conn.executeDelete: “+ ex.getMessage());
}
}
public int executeUpdate(String sql)
{
int n=0;
try
{
conn=DriverManager.getConnection(sConnStr);
Statement stmt=conn.createStatement();
n=stmt.executeUpdate(sql);
}
catch(SQLException ex)
{
System.err.println(“conn.executeDelete: “+ ex.getMessage());
}
return n;
}
public void Close()
{
try{
if(rs!=null)
{
rs.close();
}
if(conn!=null)
{
conn.close();
}
}
catch(SQLException ex)
{
System.err.println(“conn.executeDelete: “+ ex.getMessage());
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 648 2011-06-29 09:50 jspshop\jspshop\jspshop(mysql版)安装与使用方法.txt
文件 455 2011-06-25 12:57 jspshop\jspshop\jspshoping\.classpath
文件 297 2011-07-07 16:01 jspshop\jspshop\jspshoping\.myme
文件 1281 2011-06-25 13:01 jspshop\jspshop\jspshoping\.project
文件 500 2011-06-25 17:03 jspshop\jspshop\jspshoping\.settings\.jsdtscope
文件 724 2011-06-25 13:35 jspshop\jspshop\jspshoping\.settings\org.eclipse.core.resources.prefs
文件 330 2011-06-25 12:53 jspshop\jspshop\jspshoping\.settings\org.eclipse.jdt.core.prefs
文件 49 2011-06-25 17:03 jspshop\jspshop\jspshoping\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2011-06-25 17:03 jspshop\jspshop\jspshoping\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 232276 2011-06-29 09:44 jspshop\jspshop\jspshoping\jspshop.sql
文件 2024 2011-06-25 17:27 jspshop\jspshop\jspshoping\src\ckstudio\db\mysqlconn.java
文件 2025 2011-06-25 17:27 jspshop\jspshop\jspshoping\src\ckstudio\db\mysqlconn2.java
文件 817 2005-04-01 21:19 jspshop\jspshop\jspshoping\WebRoot\admin\2login.jsp
文件 813 2011-06-25 13:47 jspshop\jspshop\jspshoping\WebRoot\admin\ac.jsp
文件 781 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\ac2.jsp
文件 12829 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\addhw.jsp
文件 3500 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\addnews.jsp
文件 4590 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\addsort.jsp
文件 1300 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\addsort1.jsp
文件 1307 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\addsort2.jsp
文件 1599 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\adduser.jsp
文件 557 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\adel.jsp
文件 6867 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\changehw.jsp
文件 826 2011-06-25 13:01 jspshop\jspshop\jspshoping\WebRoot\admin\conn.jsp
文件 6332 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\delhw.jsp
文件 4776 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\delnews.jsp
文件 1771 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\editnews.jsp
文件 1774 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\editnewsok.jsp
文件 3154 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\gg.jsp
文件 453 2011-06-25 12:55 jspshop\jspshop\jspshoping\WebRoot\admin\gg2.jsp
............此处省略289个文件信息
评论
共有 条评论