vitess-gh/java
Alain Jobart c9a420fba5 Commiting log4j configs for unit tests. 2015-06-23 15:55:34 -07:00
..
gorpc java: Use gson 2.3.1 to fix compilation for maven2 users. 2015-04-20 17:33:44 -07:00
vtgate-client Commiting log4j configs for unit tests. 2015-06-23 15:55:34 -07:00
vtocc-client Implemented VtoccBsonBlockingChannel and integration tests. 2014-06-17 16:27:17 -07:00
vtocc-jdbc-driver Updated bootstrap to use env-vars. 2014-06-18 14:34:58 -07:00
.gitignore Java: add .gitignore at root folder 2014-09-12 10:40:16 -07:00
README.md Rename .markdown to .md and move Contributing.md 2014-10-17 15:40:55 -07:00
bootstrap.sh Updated bootstrap to use env-vars. 2014-06-18 14:34:58 -07:00
pom.xml Add GoRPC lib and vtgate-client in top level project 2014-09-23 09:23:36 -07:00

README.md

Java Vtocc JDBC Driver

Java JDBC driver that is intended to be as a drop-in replacement for MySQL JDBC driver to connect directly to Vtocc server.

Intended to replace configuration, monitoring and connection pooling for MySQL connection on the client side.

How to Use

  • Install dependencies by running ../bootstrap.sh
  • Try it out with ./vtocc-client
    • Run from command line java -jar ./vtocc-client/target/vtocc-client-*-jar-with-dependencies.jar
    • Check source code at ./vtocc-client/src/main/java/
  • Add dependency to your project.
    • If you're using Maven: dependency com.github.youtube.vitess.jdbcdriver, notice that it's not propagated to maven central yet
    • Not using maven? Use ./vtocc-jdbc-driver/target/vtocc-jdbc-driver-*-jar-with-dependencies.jar
  • Configure to use this driver instead of a MySQL one.
    • If you define driver class likecom.mysql.jdbc.Driver in your configuration, replace it with com.github.youtube.vitess.Driver
    • If you're using driver manager-based configuration:
      • Register driver: new com.github.youtube.vitess.Driver()
      • Use urls like this one to create connections: jdbc:vtocc://localhost:666/keyspace
    • If you're creating your connections manually use new com.github.youtube.vitess.Driver().connect(url)

Caveats

  • Be aware that MySQL database connection configuration would be shifted to Vtocc startup parameters from your application.
  • Connection between your application and Vtocc is inherently insecure as it does not require user or password.