大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
点击注销,跳转到后台,去掉当前用户session,然后跳转登录界面。
“只有客户发展了,才有我们的生存与发展!”这是创新互联的服务宗旨!把网站当作互联网产品,产品思维更注重全局思维、需求分析和迭代思维,在网站建设中就是为了建设一个不仅审美在线,而且实用性极高的网站。创新互联对成都网站设计、网站建设、网站制作、网站开发、网页设计、网站优化、网络推广、探索永无止境。
1.开户2.销户3.存钱4.取钱5.查询技术点:TcpServer服务端TcpSocket客户端多线程并发访问数据库存储数据XML组织传输的数据
用jsp写了一个注销脚本logout.jsp如下:
%
session.removeValue("UserName");
session.removeValue("UserClass");
session.invalidate();
response.sendRedirect("index.jsp");
%
才3000个开户 根本不需要多线程,如果你是直接使用JDBC连接数据库,使用JDBC批量入库,秒秒钟的事情
,给你个小例子
package realnet.jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class JdbcInsert4MysqlDemo {
// 批量操作参数 rewriteBatchedStatements=true
private static String url = "jdbc:mysql://192.168.8.110:3306/demo?rewriteBatchedStatements=true";
private static String user = "root";
private static String password = "123456";
private static String driver = "com.mysql.jdbc.Driver";
/**
* @param args
*/
public static void main(String[] args) {
JdbcInsert4MysqlDemo handler = new JdbcInsert4MysqlDemo();
// handler.testMysqlInsert();
handler.testMysqlBatchInsert();
}
/**
* testMysqlBatchInsert
*/
public void testMysqlBatchInsert() {
long startTime = System.currentTimeMillis();
Connection conn = null;
PreparedStatement pstmt = null;
String sql = "insert into TB_TEST(NAME)values(?)";
int batchNum = 1000;
try {
Class.forName(driver);
conn = DriverManager.getConnection(url, user, password);
conn.setAutoCommit(false);
pstmt = conn.prepareStatement(sql);
for (int i = 1; i = 100000; i++) {
pstmt.setString(1, "test_" + i);
pstmt.addBatch();
if (i % batchNum == 0) {
pstmt.executeBatch();
conn.commit();
}
}
pstmt.executeBatch();
conn.commit();
System.out.println("mysql 批量插入数据:100000 用时(/ms):"
+ (System.currentTimeMillis() - startTime));
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (null != pstmt) {
pstmt.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
try {
if (null != conn) {
conn.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
/**
* testMysqlInsert
*/
public void testMysqlInsert() {
long startTime = System.currentTimeMillis();
Connection conn = null;
PreparedStatement pstmt = null;
String sql = "insert into TB_TEST(NAME)values(?)";
try {
Class.forName(driver);
conn = DriverManager.getConnection(url, user, password);
conn.setAutoCommit(false);
pstmt = conn.prepareStatement(sql);
for (int i = 1; i = 100000; i++) {
pstmt.setString(1, "test_" + i);
pstmt.execute();
}
conn.commit();
System.out.println("mysql 普通插入数据:100000 用时(/ms):"
+ (System.currentTimeMillis() - startTime));
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (null != pstmt) {
pstmt.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
try {
if (null != conn) {
conn.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}