Java - Eclipse - SQLite
Issue: Troubleshooting the JDBC driver.
Attempt 1: Replaced the file path within the eclipse build path option where classpath can list the driver directly (jar file).
Attempt 2: Because of the embedded JDBC driver within the project it was unable to read some of the import statements, so I adjusted it with and without. I found out that the JDK was needed.
Attempt 3: Loaded the JDK with the classpath and jar file. It loaded and was able to read some of the import statements afterwards. But now the try-catch-finally block statement was needed, plus the auto-closeable feature also needed to be constructed with the try-catch-finally block statement.
Attempt 4: It is reading the JDBC driver is in the wrong file path. It cannot load the driver, basically.
In my quest of obtaining a clear definition of troubleshooting this database connection - I have researched and reviewed different strands of code to find different connections and why they used it. I have seen some empty commands without trace or reason for needing the empty loop (which made me question the code snippet they provided) and trust that it was because of the auto-closeable feature needing the try-catch statement but it did not list it within the parameter calls - which other snippet reasons did need. I cleaned the code with the refactor options. Nothing.
I have refactored the code, tried different approaches with the type of SQLException that would get confused with the Class not found and the ever present No Driver Found error.
I'm down to the driver being unfound, which is odd, because there is no other way to formulate it. I have tried absolute path, pasted the jar file within each branch of the absolute path to the actual file in the project folder itself. Nothing!
If you could follow along with this predicament, I sure could use some tips on how to get a simple database connection with the JDBC Driver!
No comments:
Post a Comment
Thank You For Commenting!