in reply to Inline Java not working
"not working" is exceptionally vague. That's very specific to your environment Java code that we won't be able to test, so you must explain to us exactly what you expect to happen, and more importantly, what problems are occurring, including error messages.
Also, the post will be much easier to follow if you remove all of the commented lines.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Inline Java not working
by mallett76 (Beadle) on Jan 17, 2024 at 16:39 UTC | |
I have updated my code. Unfortunately, I have not been able to get this program to run. However, at least I now have an error message I am receiving the following error message: main::java::lang::ClassNotFoundException=HASH(0x33f4400)Here is my updated code
| [reply] [d/l] [select] |
by afoken (Chancellor) on Jan 17, 2024 at 19:19 UTC | |
main::java::lang::ClassNotFoundException Java does not find a required class.
Are you sure that is sufficient? According to https://docs.oracle.com/javase%2F7%2Fdocs%2Fapi%2F%2F/java/lang/Class.html#forName(java.lang.String), this method may return a class object, but it does not initialize it. This method is documented to throw a ClassNotFoundException, so its parameter is likely to be the first problem. Java has no clue where to find the class file.
According to https://docs.oracle.com/javase/8/docs/api/java/sql/DriverManager.html#getConnection-java.lang.String-java.lang.String-java.lang.String-, this method does not throw a ClassNotFoundException. But: The DriverManager attempts to select an appropriate driver from the set of registered JDBC drivers. And that might be the second problem: The JDBC driver must somehow be registered. My guess is that that happens when the driver class is initialized, which does not happen in your code. Registers the given driver with the DriverManager. A newly-loaded driver class should call the method registerDriver to make itself known to the DriverManager. Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-) | [reply] [d/l] [select] |
by mallett76 (Beadle) on Feb 17, 2024 at 14:09 UTC | |
Yahoo! - I solved the problem - wasn't easy, but I did it. I'll share my code in case anyone else has the issue. The big item was I had to point to my class path jar file to point to terajdbc4.jar
| [reply] [d/l] |
by mallett76 (Beadle) on Feb 15, 2024 at 15:41 UTC | |
I believe I am getting closer. Running the below code
I am receiving the following error:
So, it is almost like it is calling out to the trino driver, not the Teradata driver. How would appropriately register the driver, what is the syntax? | [reply] [d/l] [select] |
|
Re^2: Inline Java not working
by mallett76 (Beadle) on Jan 04, 2024 at 20:50 UTC | |
Will look into posting with cleaner code However, when I say that it is not working, it is not doing what it is designed to do, which is to create a table - and this same code in JAVA does create a table fine The perl script does not yield any error messages However, as I'm typing this response, I noticed that it doesn't have a "strict" in the beginning of the code, so I'll look into adding and re-testing to help trouble shoot | [reply] |
|
Re^2: Inline Java not working
by mallett76 (Beadle) on Feb 17, 2024 at 14:11 UTC | |
Yahoo! - I solved the problem - wasn't easy, but I did it. I'll share my code in case anyone else has the issue. The big item was I had to point to my class path jar file to point to terajdbc4.jar
| [reply] [d/l] |
|
Re^2: Inline Java not working
by mallett76 (Beadle) on Jan 05, 2024 at 16:39 UTC | |
I removed the comments to make it easier to read. Here is the updated code.
| [reply] [d/l] |