vertx-jdbc-client
vertx-jdbc-client copied to clipboard
Result Set for CLOB TYPE with non ASCII character
Version
This bug is in the tree since 4.2.1, 4.1.1 seems ok.
Context
I just upgrade the JDBC version from 4.1.1 to 4.2.1 I saw that JDBC 4.2.1 client has using getAsciiStream to read data from oracle with CLOB type, with is getting an error with NON-ASCII character.
Do you have a reproducer?
- Save non-ASCII to Oracle with UTF-8 encoding and CLOB type.
- Get data from oracle with JDBC version 4.2.1.
- Getting the result with the difference from the database.
Hello! I have the same problem. In versión 4.1.8 works fine. If I update to version 4.2.X or higher it already fails. Incorrect characters appear than with the previous version. It also happens in the latest version 4.5.8.
Can you fix this please? It prevents me from updating the dependencies of my project... @jponge
Thanks!
Can you paste snippets for Oracle table creation and Vert.x JDBC Client code? So that we can easily reproduce. Thanks
Hello, this is the helper to execute querys. `import io.vertx.core.Vertx import io.vertx.core.json.JsonArray import io.vertx.core.json.JsonObject import io.vertx.jdbcclient.JDBCConnectOptions import io.vertx.jdbcclient.JDBCPool import io.vertx.kotlin.coroutines.await import io.vertx.sqlclient.PoolOptions import io.vertx.sqlclient.Tuple import org.slf4j.LoggerFactory
class JDBCHelper { companion object { private val LOG = LoggerFactory.getLogger(JDBCHelper::class.java) private lateinit var pool: JDBCPool
fun init(vertx: Vertx, conf: JsonObject) {
pool = JDBCPool.pool(
vertx,
JDBCConnectOptions()
.setUser(conf.getString("user"))
.setPassword(conf.getString("password"))
.setJdbcUrl(
String.format(
"jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = %s)(PORT = %s))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = %s)))",
conf.getString("host"),
conf.getInteger("port"),
conf.getString("sid")
)
)
,PoolOptions().setMaxSize(20)
)
LOG.info("Creando cliente JDBC")
}
suspend fun execPreparedQuery(queryStr: String, params: JsonArray): List<JsonObject> {
val conn = pool.connection.await()
val result = conn.preparedQuery(queryStr).execute(Tuple.from(params.list)).await()
conn.close().await()
return result.map { row -> row.toJson() }
}
suspend fun execQuery(queryStr: String): List<JsonObject> {
val conn = pool.connection.await()
val result = conn.query(queryStr).execute().await()
conn.close().await()
return result.map { row -> row.toJson() }
}
} } `
And the creation of the table:
CREATE TABLE LANDING_TEMPLATES ( LDT_ID NUMBER (10,0) NOT NULL, LDT_HTML CLOB, LDT_CSS CLOB, )
With version 4.1.8:
With last version 4.5.8:
Note: With the versions > 4.1.8 appears the problem.
Hi @tsegismont! Any news?
Thanks!
Not yet
Hello!
Do you have an estimate of when this will be resolved?
Sorry, no