You will require to do something similar after changing Drive to Oracle and in between call PreparedStatement to execute SQL.
You need to be careful when calling external DB and firing direct SQL with Maximo Framework.
import java.sql.DriverManager as DriverManager
import java.sql.SQLException as SQLException
# Replace these values with your Maximo database credentials or change
db_url = "jdbc:db2://localhost:50000/MAXDB76"
db_user = "maximo"
db_password = "maximo"
try:
# Load the DB2 JDBC driver
Class.forName("com.ibm.db2.jcc.DB2Driver")
# Connect to the Maximo database
conn = DriverManager.getConnection(db_url, db_user, db_password)
# Do something with the database connection here
# Close the database connection
conn.close()
except SQLException as e:
print("SQL Exception: ", e.getMessage())
except Exception as e:
print("Exception: ", e.getMessage())