最好在这加一个标识位,int型的,比如int flag =0
////////////在这改动
while(rs.next())
{
user_name=rs.getString("id")
user_pwd=rs.getString("pwd")
if(inputUserName.equals(user_name)&&inputUserPwd.equals(user_pwd)){
flag=1
break
}
}
if(falg==1)
JOptionPane.showConfirmDialog(null,"成功登录"," ",JOptionPane.DEFAULT_OPTION)
else
JOptionPane.showConfirmDialog(null,"用户名或密码错误"," ",JOptionPane.DEFAULT_OPTION)
更改mysql配置如下:#
Uncomment
the
following
if
you
are
using
InnoDB
tables
#innodb_data_home_dir
=
/var/lib/mysql/
innodb_data_file_path
=
ibdata1:50M:autoextend
#innodb_log_group_home_dir
=
/var/lib/mysql/
#innodb_log_arch_dir
=
/var/lib/mysql/
#
You
can
set
.._buffer_pool_size
up
to
50
-
80
%
#
of
RAM
but
beware
of
setting
memory
usage
too
high
innodb_buffer_pool_size
=
256M
innodb_additional_mem_pool_size
=
10M
#
Set
.._log_file_size
to
25
%
of
buffer
pool
size
#innodb_log_file_size
=
128M
innodb_log_buffer_size
=
8M
#innodb_flush_log_at_trx_commit
=
1
#innodb_lock_wait_timeout
=
50
innodb_support_xa=off
用mysql-connector-odbc-5[1].1.5-win32.msi这个驱动程序
哥们,你建主键了没?
排除了以上问题,还慢,就看看你的连接了,如果是自己写的,那么建议你找个别人写好的连接类试试。有时候代码没问题,db没问题,那么只有时连接的问题了!!
希望对你有用。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)