I am trying to connect to the Profiler tool with a Vertica Database. I have been able to connect using the ODBC connection and to connect to the database with a small java program using jdbc. However, I cannot identify all of the required fields on the connection page to fill them in for my database. Can you provide more information as to what these connection strings mean using a standard java jdbc connect statement as a start?
import java.sql.*;
import java.util.Properties;
public class ConnectionExample {
publicstaticvoidmain(String[]args){//LoadJDBCdrivertry{Class.forName("com.vertica.jdbc.Driver");}catch(ClassNotFoundExceptione){//Couldnotfindthedriverclass.Likelyanissue//withfindingthe.jarfile.System.err.println("CouldnotfindtheJDBCdriverclass.");e.printStackTrace();return;//Bailout.Wecannotdoanythingfurther.}//Createpropertyobjecttoholdusername&passwordPropertiesmyProp=newProperties();myProp.put("user","username");myProp.put("password","mypass");Connectionconn;try{conn=DriverManager.getConnection("jdbc:vertica://hostname.com:5433/dbname", myProp); } catch (SQLException e) { // Could not connect to database. System.err.println("Couldnotconnecttodatabase.");e.printStackTrace();return;}}
}
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your interest in osDQ. For jdbc please select
Db type - others jdbc
Do name - //hostname.com:5443/dbname
Username - username
Password - mypass
Driver - com.vertica.jdbc.Driver
Protocol - jdbc:vertica
Make sure the jar file that contains the driver is in class path. You
should be able to connect using above parameters. If you have any issue
please let me know.
I am trying to connect to the Profiler tool with a Vertica Database. I
have been able to connect using the ODBC connection and to connect to the
database with a small java program using jdbc. However, I cannot identify
all of the required fields on the connection page to fill them in for my
database. Can you provide more information as to what these connection
strings mean using a standard java jdbc connect statement as a start?
import java.sql.*;
import java.util.Properties;
public class ConnectionExample {
public static void main(String[] args) {
// Load JDBC driver
try {
Class.forName("com.vertica.jdbc.Driver");
} catch (ClassNotFoundException e) {
// Could not find the driver class. Likely an issue
// with finding the .jar file.
System.err.println("Could not find the JDBC driver class.");
e.printStackTrace();
return; // Bail out. We cannot do anything further.
}
// Create property object to hold username & password
PropertiesmyProp=newProperties();myProp.put("user","username");myProp.put("password","mypass");Connectionconn;try{conn=DriverManager.getConnection("jdbc:vertica://hostname.com:5433/dbname", myProp);} catch (SQLException e) { // Could not connect to database. System.err.println("Couldnotconnecttodatabase.");e.printStackTrace();return;}}
Hello,
I am trying to connect to the Profiler tool with a Vertica Database. I have been able to connect using the ODBC connection and to connect to the database with a small java program using jdbc. However, I cannot identify all of the required fields on the connection page to fill them in for my database. Can you provide more information as to what these connection strings mean using a standard java jdbc connect statement as a start?
import java.sql.*;
import java.util.Properties;
public class ConnectionExample {
}
Thanks!
Thanks for your interest in osDQ. For jdbc please select
Db type - others jdbc
Do name - //hostname.com:5443/dbname
Username - username
Password - mypass
Driver - com.vertica.jdbc.Driver
Protocol - jdbc:vertica
Make sure the jar file that contains the driver is in class path. You
should be able to connect using above parameters. If you have any issue
please let me know.
Regards,
Vivek
On Monday, August 11, 2014, Floyd Moore feksmoore@users.sf.net wrote:
--
reagrds,
Vivek
Author of "The Reverse Journey" from Frogbooks