{"id":23284230,"url":"https://github.com/agilecreativity/spring-oracle-hibernate-example","last_synced_at":"2025-08-21T16:32:33.504Z","repository":{"id":13561391,"uuid":"16253637","full_name":"agilecreativity/spring-oracle-hibernate-example","owner":"agilecreativity","description":null,"archived":false,"fork":false,"pushed_at":"2014-01-26T13:38:44.000Z","size":112,"stargazers_count":3,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-16T19:39:49.528Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agilecreativity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-26T13:37:45.000Z","updated_at":"2024-04-16T19:39:49.529Z","dependencies_parsed_at":"2022-07-12T15:11:23.697Z","dependency_job_id":null,"html_url":"https://github.com/agilecreativity/spring-oracle-hibernate-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Fspring-oracle-hibernate-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Fspring-oracle-hibernate-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Fspring-oracle-hibernate-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agilecreativity%2Fspring-oracle-hibernate-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agilecreativity","download_url":"https://codeload.github.com/agilecreativity/spring-oracle-hibernate-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230523775,"owners_count":18239437,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-20T01:38:57.953Z","updated_at":"2024-12-20T01:38:58.645Z","avatar_url":"https://github.com/agilecreativity.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Simple project using Oracle database with Spring, and Maven \n\n## Installation\n\n* You will need to have setup the Oracle database and populate the data using the script provided (see below)\n* You will need to copy the Oracle's jar file and install it to manually (see below) \n* Edit your hibernate.cfg.xml file to your Oracle's setup (username, password, host, port, etc)\n\n### Install Oracle's jar manually using the following command\n\n```\nmvn install:install-file -Dfile=./ojdbc.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar\n```\n\nThe reason we need to do this because we have the following section in ```pom.xml``` file\n\n    \u003cdependency\u003e\n      \u003cgroupId\u003ecom.oracle\u003c/groupId\u003e\n      \u003cartifactId\u003eojdbc6\u003c/artifactId\u003e\n      \u003cversion\u003e11.2.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\n### You will also need to create following table in Oracle using the following DDL.\n\n    CREATE TABLE DBUSER ( \n      USER_ID      NUMBER(12)    NOT NULL, \n      USER_NAME    VARCHAR2(20)  NOT NULL, \n      CREATED_BY   VARCHAR2(20)  NOT NULL, \n      CREATED_DATE DATE          NOT NULL, \n      PRIMARY KEY (USER_ID) \n    );\n\n    CREATE TABLE DEPARTMENT ( \n      DEPT_ID     NUMBER(12)   NOT NULL, \n      DEPT_NAME   VARCHAR2(20) NOT NULL, \n      PRIMARY KEY (DEPT_ID) \n    );\n\n    CREATE TABLE EMPLOYEE (\n        EMP_ID     NUMBER(12)  NOT NULL,\n        FIRST_NAME VARCHAR2(50) NOT NULL,\n        LAST_NAME  VARCHAR2(50) NOT NULL,\n        BIRTH_DATE DATE            NULL,\n        CELL_PHONE VARCHAR2(15)     NULL,\n        DEPT_ID    NUMBER(12)      NULL,\n        PRIMARY KEY(EMP_ID)\n    );\n\n    ALTER TABLE EMPLOYEE ADD (\n      CONSTRAINT EMP_DEPT_FK \n      FOREIGN KEY (EMP_ID) \n      REFERENCES DEPARTMENT(DEPT_ID));\n\n    CREATE SEQUENCE EMP_SEQ\n    START WITH 0\n    INCREMENT BY 1\n    MINVALUE 0\n    NOCACHE \n    NOCYCLE \n    NOORDER;\n\n### Edit your hibernate configuration file to your environment\n\n    \u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n    \u003c!DOCTYPE hibernate-configuration PUBLIC\n    \"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n    \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd\"\u003e\n    \u003chibernate-configuration\u003e\n      \u003csession-factory\u003e\n        \u003cproperty name=\"hibernate.connection.driver_class\"\u003eoracle.jdbc.driver.OracleDriver\u003c/property\u003e\n        \u003cproperty name=\"hibernate.connection.url\"\u003ejdbc:oracle:thin:@\u003cYOUR_SERVER_IP\u003e:1521:\u003cYOUR_SID\u003e\u003c/property\u003e\n        \u003cproperty name=\"hibernate.connection.username\"\u003eYOUR_DB_LOGIN\u003c/property\u003e\n        \u003cproperty name=\"hibernate.connection.password\"\u003eYOUR_DB_PASSWORD\u003c/property\u003e\n        \u003cproperty name=\"hibernate.dialect\"\u003eorg.hibernate.dialect.Oracle10gDialect\u003c/property\u003e\n        \u003cproperty name=\"hibernate.default_schema\"\u003eYOUR_SCHEMA_NAME\u003c/property\u003e\n        \u003cproperty name=\"show_sql\"\u003etrue\u003c/property\u003e\n        \u003cmapping resource=\"com/demo/example/dbuser.hbm.xml\"\u003e\u003c/mapping\u003e\n        \u003cmapping resource=\"com/demo/example/department.hbm.xml\"\u003e\u003c/mapping\u003e\n        \u003cmapping resource=\"com/demo/example/employee.hbm.xml\"\u003e\u003c/mapping\u003e\n      \u003c/session-factory\u003e\n    \u003c/hibernate-configuration\u003e\n\n### Once this is done you can then\n\nThen you can run the following command\n\n```\n$mvn clean eclipse:eclipse install\n```\n\nIf you want so use it from Eclipse then just use File-\u003eImport \n\n### Author\n\n[Burin Choomnuan](https://github.com/agilecoders)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilecreativity%2Fspring-oracle-hibernate-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagilecreativity%2Fspring-oracle-hibernate-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagilecreativity%2Fspring-oracle-hibernate-example/lists"}