Issue Connecting Database

38 views
Skip to first unread message

amit mahajan

unread,
Dec 11, 2023, 8:03:19 AM12/11/23
to Categorical Data

Hello,

I'm in the process of establishing a connection to PostgreSQL as part of my exploration into migrating data between PostgreSQL and SQL Server/Oracle, or vice versa. I have added the CLASSPATH pointing to "postgresql-42.7.1.jar" file in my environment variable too. While attempting to connect to PostgreSQL on my local machine using CQL IDE, I encountered the error mentioned below:


Error in command load: java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost:5432/postgres?user=postgres&password=sa123

Here is the code snippet I am using:

options
jdbc_quote_char = ""
always_reload = true
jdbc_default_string = "jdbc:postgresql://localhost:5432/postgres?user=postgres&password=sa123"

command load = exec_jdbc  "" {

}  


command view0 = exec_jdbc "" {  #see note above!!!

}


Note: I am getting a similar error when trying to connect to SQL Server too.

Please let me know what I am missing. Thanks in advance.

~AM  

Ryan Wisnesky

unread,
Dec 11, 2023, 12:02:20 PM12/11/23
to categor...@googlegroups.com
When additional jars are placed on the classpath, it is also required to start CQL from within its jar, for example, 

java -cp "cql.jar:mysql-connector-java-5.1.47.jar" catdata.ide.IDE
Hopefully that is the problem; lmk.  -Ryan

--
You received this message because you are subscribed to the Google Groups "Categorical Data" group.
To unsubscribe from this group and stop receiving emails from it, send an email to categoricalda...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/categoricaldata/fa76cfbf-694d-4379-b4cd-dfac52ae6dedn%40googlegroups.com.

amit

unread,
Dec 12, 2023, 5:46:21 PM12/12/23
to Categorical Data
Hi Ryan,

Thank you so much for the suggestion, and it works. Now I can connect to PostgreSQL and SQL Server by running the below-mentioned commands on the command prompt.

java -cp "./mssql-jdbc-12.4.2.jre11.jar;./CQL.jar" catdata.ide.IDE 

java -cp "./postgresql-42.7.1.jar;./CQL.jar" catdata.ide.IDE


~AM
Reply all
Reply to author
Forward
0 new messages