{"library":"jaydebeapi","code":"import jaydebeapi\nimport os\n\n# NOTE: Replace with your actual JDBC driver path, class name, and connection details\n# For example, using a placeholder for a generic JDBC driver (e.g., PostgreSQL)\nJDBC_DRIVER_PATH = os.environ.get('JDBC_DRIVER_PATH', '/path/to/your/jdbc_driver.jar')\nJDBC_DRIVER_CLASS = os.environ.get('JDBC_DRIVER_CLASS', 'org.postgresql.Driver')\nJDBC_URL = os.environ.get('JDBC_URL', 'jdbc:postgresql://localhost:5432/mydatabase')\nDB_USER = os.environ.get('DB_USER', 'user')\nDB_PASSWORD = os.environ.get('DB_PASSWORD', 'password')\n\ntry:\n    conn = jaydebeapi.connect(\n        JDBC_DRIVER_CLASS,\n        JDBC_URL,\n        [DB_USER, DB_PASSWORD],\n        JDBC_DRIVER_PATH\n    )\n    cursor = conn.cursor()\n    cursor.execute(\"SELECT 'Hello, JayDeBeApi!' AS message\")\n    result = cursor.fetchone()\n    print(f\"Connection successful: {result[0]}\")\n    cursor.close()\n    conn.close()\nexcept Exception as e:\n    print(f\"Error connecting to database: {e}\")\n    print(\"Please ensure your JDBC driver path, class name, URL, and credentials are correct, and that a compatible JRE is installed and JAVA_HOME is set if necessary.\")\n","lang":"python","description":"This quickstart demonstrates how to establish a connection to a database using `jaydebeapi`. You need to provide the path to your JDBC driver JAR file, the fully qualified Java class name of the driver, the JDBC connection URL, and your database credentials. Remember to set the `JDBC_DRIVER_PATH`, `JDBC_DRIVER_CLASS`, `JDBC_URL`, `DB_USER`, and `DB_PASSWORD` environment variables or replace the placeholders.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}