我的数据库与EclipseLink连接有问题。当我使用包含§符号的密码时,我得到一个SQLException。没有EclipseLink,没有问题。带§符号的EclipseLink密码
我试过其他没有EclipseLink的特殊字符:§和$是唯一合法的特殊字符。包含$符号的密码也适用于EclipseLink,而包含§符号的密码则不适用。
我的猜测是EclipseLink将用导致下面错误的代码替换§。有人已经处理了这个?有没有办法解决它?
例外:
内部异常:java.sql.SQLException中,应用服务器拒绝连接。 (用户ID或密码包含一个字符无效。) 错误代码:-99999
数据库:AS400 iSeries的
JPA提供商:的EclipseLink 2.4.1
持久性XML:
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="unit1" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<mapping-file>META-INF/bvlistenermapping.xml</mapping-file>
<class>...</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
<validation-mode>NONE</validation-mode>
<properties>
<property name="eclipselink.target-database"
value="de.meyerwerft.common.db.helper.DB2UDBiSeriesPlatform" />
<property name="javax.persistence.jdbc.driver" value="com.ibm.as400.access.AS400JDBCDriver" />
<property name="javax.persistence.jdbc.url"
value="jdbc:as400://###;prompt=false;naming=sql;errors=full;date format=eur;time format=eur;decimal separator=.;blocksize=512;translate binary=true;" />
<property name="eclipselink.logging.level" value="FINEST" />
<property name="eclipselink.logging.logger"
value="###" />
</properties>
</persistence-unit>
在此先感谢您提供任何有用的提示。
Greetz Malte
我对涉及什么有效,什么不可行的句子有些困惑,因为它们有点矛盾。以下是我正在阅读的内容:使用EclipseLink时,'§'和'$'被视为非法字符。没有EclipseLink,没有人被视为非法字符。它是否正确? – Pokechu22 2014-10-07 14:23:25
使用EclipseLink将$视为合法,将§视为非法字符。没有EclipseLink,这两个都是合法的。 – DarthWanye 2014-10-07 14:26:00
这可能与加密/解密不处理特殊字符的密码有关:http://wiki.eclipse.org/EclipseLink/FAQ/Security – Chris 2014-10-07 15:52:24