Jdbc driver and blob reading

104 views
Skip to first unread message

Yohan Bismuth

unread,
Sep 9, 2020, 6:12:40 AM9/9/20
to vitess
Hello,
I have a java application connecting to mysql with jdbc driver.
I started a vtgate and it's running fine, then I replaced the driver my application used with io.vitess.jdbc.VitessDriver.

It works fine so far, but I encoutered an issue when trying to read a longblob from the database (SQL_FEATURE_NOT_SUPPORTED exception). It seems the method is not implemented:

I managed to workaround the issue using CLOB (which are implemented) instead of BLOB. I also had to override my mysql dialect to avoid streaming clobs as it's not working as well. Ideally I would like not to do all of that.

I found it strange that blob reading wasn't implemented in the driver, so I double checked the documentation and read that :
Vitess supports MySQL binary protocol. This allows existing applications to connect to Vitess directly without any change, or without using a new driver or connector. This is now the recommended and the most popular protocol for connecting to Vitess.

So I tried to keep my mysql driver instead of using the VitessJdbcDriver, and I ended up with this exception this time:
Caused by: java.lang.RuntimeException: Driver com.mysql.jdbc.Driver claims to not accept jdbcUrl, jdbc:vitess://127.0.0.1:15991

Am I missing something ? Did I use the right driver to begin with ?

Harshit Gangal

unread,
Sep 9, 2020, 7:53:30 AM9/9/20
to vit...@googlegroups.com
you should continue to use the normal mysql url
jdbc:mysql://localhost:15306/<dbname>
15306 is the default mysql port on vtgates.

Lifen - Mention Légale (Legal Disclaimer)

L'information dans ce message est destinée uniquement aux destinataires nommés à qui il est adressé et peut contenir des informations confidentielles et/ou privilégiées. Si vous n'êtes pas un destinataire prévu, vous ne pouvez pas réviser, copier ou distribuer ce message. Si vous avez reçu ce message par erreur, veuillez nous en informer immédiatement en répondant à cet e-mail, puis supprimez-le de votre système

The information contained in this email is intended solely for the named recipients to whom it is addressed and may contain confidential and/or privileged material. If you are not an intended recipient you may not review, copy or distribute this message. If you have received this message in error, please notify us immediately by replying to this email and then delete it from your system

--
You received this message because you are subscribed to the Google Groups "vitess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vitess+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vitess/973ce5bc-680b-43d9-859c-86b1575e5f4en%40googlegroups.com.

Yohan Bismuth

unread,
Sep 9, 2020, 8:58:03 AM9/9/20
to vitess
I was using the wrong url:port indeed, thank you for the quick answer !
Reply all
Reply to author
Forward
0 new messages