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
use strict; use warnings; use Inline Java => <<'END'; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; public class TeradataTableCreator { public static void createTable(String jdbcUrl, String username, Stri +ng password) throws Exception { // Load Teradata JDBC driver Class.forName("com.teradata.jdbc.TeraDriver"); // Establish the connection Connection connection = DriverManager.getConnection(jdbcUrl, usern +ame, password); // Create a Statement Statement statement = connection.createStatement(); // Execute the SQL statement to create a sample table String createTableSQL = "CREATE TABLE SampleTable (ID INT, Name VA +RCHAR(255))"; statement.executeUpdate(createTableSQL); // Close resources statement.close(); connection.close(); } } END # Specify your Teradata connection details my $jdbcUrl = "jdbc:teradata://000.00.000.00/TMODE=TERA,DBS_PORT=1025, +CHARSET=UTF8,LOGMECH=LDAP,SSLMODE=ALLOW"; my $username = "XXXXX"; my $password = "XXXXXX"; # Call the Java method to create the table TeradataTableCreator->createTable($jdbcUrl, $username, $password);
In reply to Re^2: Inline Java not working
by mallett76
in thread Inline Java not working
by mallett76
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |