Reading string with exclamation mark includes a period

Dale :

I'm reading and writing from an mdb file* and doubling the exclamation marks to get a single exclamation mark (bang) into the database field.

aStringBuffer.append("'" + target.getTitle().replaceAll("!","!!") + "',");

The field above is used in an insert into ... statement successfully with the content starting out as Sample!, getting changed to Sample!! in the StringBuffer, and back to Sample! when I look at it in the table within the mdb.

Later, though, when I read the value using rs = aStatement.executeQuery(...)

then rs.getString(aField), I get [Sample.!] instead of [Sample!].

Notice that there seems to be an unexpected "dot" or extra "period" in the result.

I'm wondering if this is a bug or if it's just something that I'm doing wrong.

*Windows 7, using ucanaccess version 2.0.9.4, JRE 1.8.0.

Gord Thompson :

UCanAccess version 2.0.9.4 is ancient. This bug was fixed in version 3.0.3.1 over 3.5 years ago. Look here (or on Maven Central) to get the latest version.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=328603&siteId=1