Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result Set for CLOB TYPE with non ASCII character #257

Open
hungnt1997 opened this issue Nov 30, 2021 · 7 comments
Open

Result Set for CLOB TYPE with non ASCII character #257

hungnt1997 opened this issue Nov 30, 2021 · 7 comments
Assignees
Labels
Milestone

Comments

@hungnt1997
Copy link

hungnt1997 commented Nov 30, 2021

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?

  1. Save non-ASCII to Oracle with UTF-8 encoding and CLOB type.
  2. Get data from oracle with JDBC version 4.2.1.
  3. Getting the result with the difference from the database.
@hungnt1997 hungnt1997 added the bug label Nov 30, 2021
@hungnt1997 hungnt1997 changed the title Result Set for clob with non ASCII character Result Set for CLOB TYPE with non ASCII character Nov 30, 2021
@JGrancha
Copy link

JGrancha commented May 31, 2024

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!

@tsegismont tsegismont self-assigned this May 31, 2024
@tsegismont tsegismont added this to the 4.5.9 milestone May 31, 2024
@tsegismont
Copy link
Contributor

Can you paste snippets for Oracle table creation and Vert.x JDBC Client code? So that we can easily reproduce. Thanks

@JGrancha
Copy link

JGrancha commented May 31, 2024

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:
image

With last version 4.5.8:
image

Note: With the versions > 4.1.8 appears the problem.

@JGrancha
Copy link

JGrancha commented Jun 4, 2024

Hi @tsegismont! Any news?

Thanks!

@tsegismont
Copy link
Contributor

Not yet

@vietj vietj modified the milestones: 4.5.9, 4.5.10 Jul 17, 2024
@vietj vietj modified the milestones: 4.5.10, 4.5.11 Sep 4, 2024
@JGrancha
Copy link

JGrancha commented Sep 9, 2024

Hello!

Do you have an estimate of when this will be resolved?

@tsegismont
Copy link
Contributor

Sorry, no

@vietj vietj modified the milestones: 4.5.11, 4.5.12 Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants