Feb-16-2024, 06:26 PM
(This post was last modified: Feb-16-2024, 06:56 PM by deanhystad.)
I am trying to connect to a solid DB using JDBC drivers and the program just prints "point - 0" and quits. I cannot do anything because the frustrating thing is it doesn't even raise exception so how can I understand what is wrong? If someone can at least guide me how to raise an exception it would be appreciated. Somehow the program is crashing in the connection.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
import jaydebeapi # Path to the Solid JDBC driver JAR file jdbc_driver_jar = "C:\\Solid\\SolidDriver2.0.jar" # JDBC URL for connecting to Solid # JDBC driver class name jdbc_driver_class = "com.solid.jdbc.SolidDriver" # Database username and password username = "xxxx" password = "xxx" # Establishing the connection using JayDeBeApi print ( 'point - 0' ) try : connection = jaydebeapi.connect( jdbc_driver_class, jdbc_url, [username, password], jdbc_driver_jar) except Exception as e: raise e finally : print ( 'finally' ) print ( 'point - 1' ) cursor = connection.cursor() print ( 'point - 2' ) cursor.execute( "SELECT * FROM discount" ) results = cursor.fetchall() print (results) cursor.close() connection.close() |
deanhystad write Feb-16-2024, 06:56 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.