How to connect to Vitess database with JDBC connector - jdbc

I'm trying to connect to Vitess database.
To my best knowledge I have to use dedicated JDBC connector (https://mvnrepository.com/artifact/io.vitess/vitess-jdbc) for the Vitess. I have tried to connect like this:
#1 jdbc:vitess://user:password#hostname:port/
#2 jdbc:vitess://user:password#hostname:port/my_schema
#3 jdbc:vitess://user:password#hostname:port/my_schema#replica
#4 jdbc:vitess://user:password#hostname:port/keyspace/my_schema
but I'm getting following error:
Driver class 'io.vitess.proto.Query$ExecuteOptions$IncludedFields' not found.
I have found information regarding IncludedFields in https://vitess.io/zh/docs/reference/vitess-api/
I also tried to put this value into database url (?included_fields=all or ?included_fields=2), but apparently there is no effect at all.
Is there any way to connect to Vitess through JDBC connector?

Vitess can be used with mysql driver with connection string "jdbc:mysql://:
The Vitess JDBC driver uses grpc protocol, currently it is not managed.
For now, we suggest to use mysql java connector.

Related

wso2 connection mysql jdbc

i tried to connect an mysql in api manager wso2 jdbc using this url jdbc:mysql://localhost:3306/eemp?allowPublicKeyRetrieval=true&useSSL=false
but gets an error:
The data source URL is not accepted by any of the loaded drivers.
Cannot load connection class because of underlying exception:
com.mysql.cj.exceptions.WrongArgumentException: Malformed database
URL, failed to parse the connection string near
';useSSL=false'.
I think you are having the URL as follows.
jdbc:mysql://localhost:3306/db?allowPublicKeyRetrieval=true&useSSL=false
Try the following
jdbc:mysql://localhost:3306/db?allowPublicKeyRetrieval=true&useSSL=false

JDBC connection error for HIVE while using SQL WorkbenchJ

I am trying to establish a JDBC connection to access HIVE via SQL workbenchJ. I have placed all the JARs needed for connection along with the connection URL. Am getting the error
[Amazon]HivejdbcDriver error initialized or created
transport for authentication:null
while testing the connection. Can anyone help me on this?

Database connection for JDBC request on jmeter

For JDBC request on Jmeter I have configured properly Database Connection Configuration with giving
Database Url- jdbc:mysql://developmentdb.cwwxeukesrtn.ap-southeast-1.rds.amazonaws.com;Development_DB
JDBC Driver Class- com.mysql.jdbc.Driver
Username-...
Password-...
then I create a JDBC request with Select Statementbut after run this request,on the response message got this message-
Response message:
java.sql.SQLException: Cannot create PoolableConnectionFactory (Communications link failure The last packet sent successfully to the
server was 0 milliseconds ago. The driver has not received any packets
from the server.)
Now my question is , how to solve this problem?
You need two basic things to get that done:
Tunneling
mysql.jdbc jar in JMeter lib folder.
For 1st:
Open Putty
Go to Connection >> SSH >> Tunnels
Put down the details as port: 9876
Put down the details as database URL (present in the application config file), e.g:
jdbc:mysql://developmentdb.cwwxeukesrtn.ap-southeast-.rds.amazonaws.com;Development_DB
Add it
Open JMeter >> Add JDBC Connection Configuration
Use DataBase URL as jdbc:mysql://localhost:9876 and the
other details as shown in the picture, like JDBC driver Class
For step 2. Go through this link:
https://www.blazemeter.com/blog/mysql-database-and-jmeter-how-to-test-your-connection/
Looking into Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J article:
I believe you need to replace the semicolon before Development_DB with a slash like:
jdbc:mysql://developmentdb.cwwxeukesrtn.ap-southeast-1.rds.amazonaws.com/Development_DB
For more information on databases load testing see The Real Secret to Building a Database Test Plan With JMeter article.
You might also need to open port 3306 in your operating system firewall and add the relevant Security Group to your instance in order to allow MySQL JDBC traffic.

Cannot establish a connection to orientdb using jdbc driver?

I'm newbie to the orientdb, I'm using netbeans's (add new connection wizard) to add a connection to the orientdb, I used orientdb-jdbc-2.0.2-all.jar as a jdbc driver, but I got the following error after clicking on test connection
Snapshot of the error
I made sure that the database is connected and everything is right, any idea?
The URL should be jdbc:orient:remote:localhost/Sensor_Data
Look at the documentation: http://www.orientechnologies.com/docs/last/orientdb-jdbc.wiki/Home.html#first-get-a-connection.
the problem should be in the connection port. You are using 2480 (HTTP port) instead of 2424 (binary protocol).

Connect to IBM DB2 with SQuirreL "Reply.fill(). Message: Insufficient data. ERRORCODE=-4499, SQLSTATE=08001"

I have now tried 2 days to connect to external DB2 database with SQuirreL. I always get error:
[jcc][t4][2030][11211][3.58.82] A communication error occurred during operations
on the connection's underlying socket, socket input stream, or socket output
stream. Error location: Reply.fill(). Message: Insufficient data.
ERRORCODE=-4499, SQLSTATE=08001
I am using IBM DB2 Universal JDBC driver v9.7 FP5. I have as well tried v9.5.
One thing is that the DB2 is tunneled with Putty. Server runs linux with IBM DB2 v7.1. I am using Win7x64.
I have ran over many forum topics on the web which cover this error, but none of them has actually worked for me. (ie. iReport to DB2 connection ERRORCODE=-4499, SQLSTATE=08001)
First I thought that maybe this related to port that isn't corretcly tunneled. But I removed the port from Putty session conf and different error occured.
Stack trace as well for the problem:
com.ibm.db2.jcc.am.io: [jcc][t4][2030][11211][3.58.82] A communication error
occurred during operations on the connection's underlying socket, socket input
stream, or socket output stream. Error location: Reply.fill(). Message:
Insufficient data. ERRORCODE=-4499, SQLSTATE=08001
at com.ibm.db2.jcc.am.ed.a(ed.java:319)
at com.ibm.db2.jcc.t4.a.a(a.java:416)
at com.ibm.db2.jcc.t4.a.a(a.java:411)
at com.ibm.db2.jcc.t4.cb.b(cb.java:227)
at com.ibm.db2.jcc.t4.cb.c(cb.java:249)
at com.ibm.db2.jcc.t4.cb.c(cb.java:360)
at com.ibm.db2.jcc.t4.cb.v(cb.java:1145)
at com.ibm.db2.jcc.t4.db.a(db.java:42)
at com.ibm.db2.jcc.t4.b.m(b.java:1238)
at com.ibm.db2.jcc.t4.b.b(b.java:1112)
at com.ibm.db2.jcc.t4.b.c(b.java:700)
at com.ibm.db2.jcc.t4.b.b(b.java:686)
at com.ibm.db2.jcc.t4.b.a(b.java:367)
at com.ibm.db2.jcc.t4.b.<init>(b.java:307)
at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:214)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:456)
My best guess was and is still that JDBC universal driver is not backward compatible with DB2 v7.1.
It works on an other development machine (coworker) with 32bit XP on it. I have tried to put it working on different 32bit XP but the same result occurs.
Can anyone at least describe the root of this anomaly?
Edit
http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14779629
This cannot be a firewall or tunneling error. Successfully opened a tunnel to correct port with telnet.
You need to locate and use the DB2 7.2 or DB2 7.1 client code (aka DB2 Client Application Enabler). Prior to DB2 8.1, IBM used a different, platform-dependent protocol called DB2RA for communication between the client and server. DB2 8.1 switched to the standard DRDA protocol. DB2 8.x clients could, in specific configurations, talk to DB2 7.x servers.
Alternatively, if you are using a Java application, you could try to locate/use the Type 3 JDBC driver (COM.ibm.db2.jdbc.net.DB2Driver). This driver is clientless (it has a 3-tier architecture, because it requires a so-called "JDBC Applet Server" to be running on the database server. You can see if it's running on your linux box by looking for a process called db2jd. Generally this process will show up as, for example, db2jd 6789, where 6789 is the port number the applet server is listening on. If you don't see this process you can start it (as the DB2 instance owner) by executing the db2jstrt command.
Another possibility: You may need to restart the computer. In my case, this worked for me. I got this error after installing a special build of DB2 10.5.
For more diagnostics, you can get your IBM JDBC driver version using: java com.ibm.db2.jcc.DB2Jcc -version
Or, try: java -cp ./db2jcc.jar com.ibm.db2.jcc.DB2Jcc -version. Then co-relate the driver version to the Db2 version. Link with more details.

Resources