Showing results for 
Search instead for 
Did you mean: 

On-Premise Admin: How to test JDBC Connection

On-Premise Admin: How to test JDBC Connection

In this article, you will learn how to use a standalone JDBC application to test connection and performance test to your JDBC Data Source. 

Overall Steps:

1. Edit attached to your JDBC String, username, password and test query
2. Upload both and java source file to Paxata server (any path is fine)
3. Copy the JDBC Jar file(s), such as jtds-1.3.1.jar, to the same path as on Paxata Server
4. Compile and run the following JDBC class on Paxata Server 

# javac -source 1.7 -target 1.7
# java -classpath .:jtds-1.3.1.jar JDBCTest

Sample result:

You entered JDBC String: jdbc:jtds:sqlserver://
You entered USER: xxxx
You entered ClassName: net.sourceforge.jtds.jdbc.Driver
You also entered DB PASSWORD.

-------- JDBC Connection Testing ------

JDBC Driver Registered!
Connected to Database Query:select * from paxata.dbo.OneMillion
Column count: 22 ID (numeric),Case Number (varchar),Date (varchar),Block (varchar),IUCR (varchar),Primary Type (varchar),Description (varchar),Location Description (varchar),Arrest (varchar),Domestic (varchar),Beat (numeric),District (varchar),Ward (numeric),Community Area (numeric),FBI Code (numeric),X Coordinate (numeric),Y Coordinate (numeric),Year (numeric),Updated On (varchar),Latitude (numeric),Longitude (numeric)

==============JDBC GET METADATA FINISHED========================
==============COUNTING RESULTSET ROWS========================

First 1,000 rows read. It took 0.076 seconds;
First 10,000 rows read. It took 0.123 seconds;
First 100,000 rows read. It took 0.398 seconds;
First 1,000,000 rows read. It took 2.625 seconds;
All 1072368 rows read. It took 2.797 seconds.
Connection is closed.

0 Kudos
0 Replies