Driver" com.mysql.jdbc.Driver"不支持网址" null"

时间:2015-05-04 00:35:43

标签: java mysql jdbc

Eclipse抛出了以下异常

ArrayList<Map> list;

descendingComparator = new Comparator<Map>() {
    @Override
    public int compare(Map lhs, Map rhs) {
        return -1;
    }
};

这是我的context.xml:

java.sql.SQLException: Driver "com.mysql.jdbc.Driver" does not support the url "null"

1 个答案:

答案 0 :(得分:2)

connectionUrl应该是connectionURL,就像

一样
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/advancedweb">
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="com.mysql.jdbc.Driver"
    connectionURL="jdbc:mysql://localhost:3306/saketramdurbha_test"
    connectionName="root" connectionPassword="pass"
    userTable="adminspass" userNameCol="Username" userCredCol="Password"
    userRoleTable="adminsrole" roleNameCol="Rolename" />
</Context>