连接mysql的javabean实例+简单分页
<%@ page contentType="text/html;charset=GBK" language="java" import="java.sql.*,java.util.*"%>
<html>
<head>
<title>连接mysql的javabean实例+简单分页</title>
<link href="../CSS.css" rel="stylesheet" type="text/css">
</head>
<body>
<jsp:useBean id="mypage" class="ckstudio.db.mysqlconn" scope="page"/>
<table width="1024"><tr>
<td>rs.getString(user_id)</td>
<td>rs.getString(user_name)</td>
<td>rs.getString(user_mail)</td>
<td>rs.getString(user_adds)</td>
</tr>
<br>
<tr>
<td style="hight:8px:width:%25;background-color:red;">
<td style="hight:8px:width:%25;background-color:red;">
<td style="hight:8px:width:%25;background-color:red;">
<td style="hight:8px:width:%25;background-color:red;">
</tr>
<%!
int Cint(String cint)
{
try {
int n;
n= Integer.parseInt(cint);
return n;
}
catch (NumberFormatException e) {
return 0;
}
}
%>
<%
int PageSize=5; //设置每页显示的记录条数
int ShowPage=1; //设置想要显示的页数
int RowCount = 0; //ResultSet的记录数目 初始值
int PageCount = 0; //ResultSet分页后的总页数 初始值
int duoyu=0; //设置分页最后一页的记录数 初始值
//以上是对这些数据的初始化 pagesize可自行设置
String sql="select * from member order by user_id desc";
ResultSet rs=mypage.executeQuery(sql);
//建立ResultSet(结果集)对象,并执行SQL语句
%>
<%if(rs.next())
{
rs.last(); //将指标移至最后一笔记录
RowCount=rs.getRow();
duoyu=RowCount % PageSize;
&nbs
相关文档:
搞了很久。。终于发现原来是权限问题。。
2行命令搞定
grant all privileges on rogue.* to admin@localhost identified by 'admin' with grant option
grant all privileges on rogue.* to admin@'%' identified by 'admin' with grant option
经典了。。。
魔力私服网页端搞定咯~~ ......
我们知道用powerdesigner导出的sql文件后缀为'.sql';用phpmyadmin很容易导入MysQL数据库,但是用PHP怎么导入数据库呢?
我用powerdesigner设计一个数据库后导出sql文件(一个投票系统)为'vote.sql';
文件内容为(一些sql语句和注释):
/*======================= ......
这个文件超级大, 查了一下, 大概的作用如下
是储存的格式
INNODB类型数据状态下,
ibdata用来储存文件的数据
而库名的文件夹里面的那些表文件只是结构而已
由于mysql4.1默认试innodb,所以这个文件默认就存在了http://man.chinaunix.net/database/mysql/inonodb_zh/2.htm 这个链接试innodb的中文参考, innodb的东 ......
引自 http://www.itpub.net/thread-1034410-1-1.html
Mysql Explain 详解
一.语法
explain < table_name >
例如: explain select * from t3 where id=3952602;
二.explain输出解释
+----+-------------+-------+-------+-------------------+---------+---------+-------+------+-------+
| id | select_type ......
一、IP信息列表:
名称 IP
LVS-DR-VIP 192.168.50.245
LVS-DR-Master ......