jive数据库配置

03-08-22 ww9507
我通过程序测试, 我的数据库驱动没有错误

程序如下:

import java.sql.*;

public class testsql

{

Connection con=null;

ResultSet rst=null;

Statement stat=null;

public static void main(String[] args)

{

new testsql();

}

public testsql()

{

connect();

}

private void connect()

{

try

{

Class.forName("org.gjt.mm.mysql.Driver");

con=DriverManager.getConnection("jdbc:mysql://localhost:3306/jive?user=wang;password=");

stat = con.createStatement();

rst = stat.executeQuery("SELECT * FROM jiveuser");

while(rst.next())

{

System.out.println(rst.getString(2)+" "+rst.getString(3));

}

}

catch(Exception e)

{

System.out.println("Exception : "+e);

}

}

}

程序运行正常,但我在配置jive论坛数据库时出错:

提示:"数据库连接不能建立。打开日志文件\"jiveHome\\logs\\DefaultConnectionProvider.log\" 查看错误信息然后返回修正错误。";

请问哪位能给予指点....谢谢了。。。。

再有我在mysql环境中加用户时,同时也加入了密码,但密码总是自动为空...百思不解......

lexus
2003-08-25 00:55
我也是这个问题

logs中内容是:

Starting ConnectionPool:

dbDriver = org.gjt.mm.mysql.Driver

dbServer = jdbc:mysql://localhost/jive?useUnicode=true;characterEncoding=GBK

dbLogin = admin

log file = D:\java\jivejdon\jivejdon\application\WEB-INF\jiveHome\logs\DefaultConnectionProvider.log

minconnections = 3

maxconnections = 10

Total refresh interval = 0.5 days

-----------------------------------------

--->Attempt (1 of 5) failed to create new connections set at startup:

java.sql.SQLException: Invalid authorization specification: Access denied for user: 'wang@127.0.0.1' (Using password: YES)

Will try again in 10 seconds...

--->Attempt (2 of 5) failed to create new connections set at startup:

java.sql.SQLException: Invalid authorization specification: Access denied for user: 'wang@127.0.0.1' (Using password: YES)

Will try again in 10 seconds...

--->Attempt (3 of 5) failed to create new connections set at startup:

java.sql.SQLException: Invalid authorization specification: Access denied for user: 'wang@127.0.0.1' (Using password: YES)

Will try again in 10 seconds...

--->Attempt (4 of 5) failed to create new connections set at startup:

java.sql.SQLException: Invalid authorization specification: Access denied for user: 'wang@127.0.0.1' (Using password: YES)

Will try again in 10 seconds...

All attempts at connecting to Database exhausted

请问该如何解决??

3x

猜你喜欢