JDBC connectivity with MemSQL

How do i connect my java application with memSQL(code level), way to do JDBC connectivity with MemSQL and how is it different from other RDBMS such as MySQL/ Oracle etc.

MemSQL uses the MySQL Wire Protocol. You can find recommended client drivers including the MariaDB JDBC driver in the MemSQL documentation here.

@jack can you help me in that

Can i have sample code for java JDBC connectivity with memSQL

I haven’t personally had to code with it. However, I Googled “MariaDB Java sample code” and found the following. It shouldn’t be any different for MemSQL.

1 Like

Thanks so much Brandon for helping Hitesh out!

FWIW: While adding MemSQL support to jOOQ (https://jooq.org/), where a wide set of JDBC features are tested, I mostly tested with the MySQL driver, as I had more smaller glitches with the MariaDB JDBC driver. I still need to track these down in detail, but I still fared better with the MySQL driver.

hi @bvincent regarding jdbc properties, wondering if memsql honors various *timeout jdbc properties, for instance query_timeout https://mariadb.com/kb/en/about-mariadb-connector-j/#set-a-query-timeout. Thanks for your help.

We understand memsql resource_pool feature also allow configurable query_timeout, but we’d prefer the flexibility of query_timeout setting on client side https://docs.memsql.com/v6.8/reference/sql-reference/resource-pool-commands/create-resource-pool/

Our java app uses mysql-5.1.6 connect to memsql-5.8 (yeah, we are working on upgrade, but not there yet…).