{"id":18841264,"url":"https://github.com/dcm4che/dcm4che-jdbc-prefs","last_synced_at":"2025-04-14T07:11:00.219Z","repository":{"id":4048576,"uuid":"5150878","full_name":"dcm4che/dcm4che-jdbc-prefs","owner":"dcm4che","description":"Java Preferences JDBC wrapper","archived":false,"fork":false,"pushed_at":"2020-10-12T21:37:33.000Z","size":129,"stargazers_count":4,"open_issues_count":4,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-27T20:51:11.230Z","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/dcm4che.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":"2012-07-23T11:28:11.000Z","updated_at":"2024-02-21T09:17:10.000Z","dependencies_parsed_at":"2022-09-16T20:51:23.217Z","dependency_job_id":null,"html_url":"https://github.com/dcm4che/dcm4che-jdbc-prefs","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcm4che%2Fdcm4che-jdbc-prefs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcm4che%2Fdcm4che-jdbc-prefs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcm4che%2Fdcm4che-jdbc-prefs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcm4che%2Fdcm4che-jdbc-prefs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcm4che","download_url":"https://codeload.github.com/dcm4che/dcm4che-jdbc-prefs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837287,"owners_count":21169374,"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-11-08T02:50:34.440Z","updated_at":"2025-04-14T07:11:00.195Z","avatar_url":"https://github.com/dcm4che.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"dcm4che-jdbc-prefs-1.x\n======================\nSource: https://github.com/dcm4che/dcm4che-jdbc-prefs  \nTracker: http://www.dcm4che.org/jira/browse/JDBCPREFS\n\nThis project provides a wrapper for storage of Java Preferences data in a SQL backend.\nIt contains a JBoss AS7 deployable jar file and a jar file containing classes for use \nwith command line tools to allow wrapping of java.util.prefs.PreferencesFactory to the \naccording SQL backend.\n\nDependencies\n------------\n[schema-export](https://github.com/dcm4che/schema-export)  \n[Maven 3](http://maven.apache.org)\n\nBuild\n-----\nChange to the root of the project directory and execute `$ mvn install [-D db=\u003cdatabase\u003e] [-D ds=\u003cdatasource\u003e]`\n\nSupported databases are: oracle, mysql, psql, mssql, hsql, firebird, and db2.\n\nExample JDBC datasource: `jdbc:oracle:thin:@localhost:1521:xe`  \nExample JBoss AS7 datasource: `java:jboss/datasources/DicomPreferencesDS`\n\nNote: The datasource value can also be configured after compiling the project\nthrough editing of `META-INF/persistence.xml` within the compiled jar file \nor by setting the parameter `jdbc.prefs.datasource` with the according value\non the command line (e.g. `-Djdbc.prefs.datasource=jdbc:oracle:thin:@localhost:1521:xe`)\nor as JBoss system property (e.g. `\u003cproperty name=\"jdbc.prefs.datasource\" value=\"java:jboss/datasources/DicomPreferencesDS\"/\u003e`).\n\nDatabase Config\n---------------\nAfter compiling the project, import the file `dcm4che-jdbc-prefs/target/create-\u003cdatabase\u003e.ddl` into your database.\nThis will create the required tables and indices.\n\nJBoss AS7 Configuration and Deployment\n--------------------------------------\n# Container Configuration\n* Edit the xml file of the container configuration (e.g. `standalone/configuration/standalone.xml`) and add\nthe following system properties underneath the `\u003c/extension\u003e` node:\n\n```xml\n\u003csystem-properties\u003e\n    \u003cproperty name=\"java.util.prefs.PreferencesFactory\" value=\"org.dcm4che.jdbc.prefs.PreferencesFactoryImpl\"/\u003e\n    \u003cproperty name=\"jdbc.prefs.datasource\" value=\"java:jboss/datasources/DicomPreferencesDS\"/\u003e\n\u003c/system-properties\u003e\n```\n* Configure the datasource: [JBoss AS7 Data Source Configuration](https://community.jboss.org/wiki/DataSourceConfigurationInAS7)\n\nNote: Import an SQL driver to be used with the datasource beforehand and set the user name and password\naccording to your database configuration.\n\nExample:\n```xml\n\u003csubsystem xmlns=\"urn:jboss:domain:datasources:1.0\"\u003e\n    \u003cdatasources\u003e\n         \u003cdatasource jndi-name=\"java:jboss/datasources/DicomPreferencesDS\" pool-name=\"DicomPreferencesDS\"\u003e\n             \u003cconnection-url\u003ejdbc:oracle:thin:@localhost:1521:xe\u003c/connection-url\u003e\n             \u003cdriver\u003eojdbc6.jar\u003c/driver\u003e\n             \u003csecurity\u003e\n                 \u003cuser-name\u003eprefs\u003c/user-name\u003e\n                 \u003cpassword\u003eprefs\u003c/password\u003e\n             \u003c/security\u003e\n         \u003c/datasource\u003e\n    \u003c/datasources\u003e\n\u003c/subsystem\u003e\n```\n\n# Deployment\nConnect to the JBoss Command Line Interface (e.g. by executing `./\u003cjboss-path\u003e/bin/jboss-cli.sh -c`) and deploy the jar file: \n`[standalone@localhost:9999 /] deploy \u003cbuild-path\u003e/dcm4che-jdbc-prefs/dcm4che-jdbc-prefs/target/dcm4che-jdbc-prefs-\u003cversion\u003e.jar`.\n\n# Restart JBoss AS7\nOnce the container configuration is done and the jar file is deployed, it is required to restart JBoss in order to load the\nmapping from PreferencesFactory to PreferencesFactoryImpl and to use the classes found in the deployed jar file.\n\nThe output in the server log should look similar to this:\n```\n...\n08:28:55,205 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of \"dcm4che-jdbc-prefs-1.0.0-SNAPSHOT.jar\"\n08:28:55,210 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of \"ojdbc6.jar\"\n08:28:55,233 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory /opt/jboss-as-7.1.1.Final-proxy-web-conf/standalone/deployments\n08:28:55,498 INFO  [org.jboss.as.jpa] (MSC service thread 1-2) JBAS011401: Read persistence.xml for dcm4che-jdbc-prefs\n08:28:55,713 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named QueryPreferencesBean in deployment unit deployment \"dcm4che-jdbc-prefs-1.0.0-SNAPSHOT.jar\" are as follows:\n\n\tjava:global/dcm4che-jdbc-prefs-1.0.0-SNAPSHOT/QueryPreferencesBean!org.dcm4che.jdbc.prefs.QueryPreferences\n\tjava:app/dcm4che-jdbc-prefs-1.0.0-SNAPSHOT/QueryPreferencesBean!org.dcm4che.jdbc.prefs.QueryPreferences\n\tjava:module/QueryPreferencesBean!org.dcm4che.jdbc.prefs.QueryPreferences\n\tjava:global/dcm4che-jdbc-prefs-1.0.0-SNAPSHOT/QueryPreferencesBean\n\tjava:app/dcm4che-jdbc-prefs-1.0.0-SNAPSHOT/QueryPreferencesBean\n\tjava:module/QueryPreferencesBean\n\n08:28:55,834 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)\n08:28:55,898 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/DicomPreferencesDS]\n08:28:56,077 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) JBAS011402: Starting Persistence Unit Service 'dcm4che-jdbc-prefs-1.0.0-SNAPSHOT.jar#dcm4che-jdbc-prefs'\n08:28:56,235 INFO  [org.hibernate.annotations.common.Version] (MSC service thread 1-3) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}\n08:28:56,243 INFO  [org.hibernate.Version] (MSC service thread 1-3) HHH000412: Hibernate Core {4.0.1.Final}\n08:28:56,257 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-3) HHH000206: hibernate.properties not found\n08:28:56,275 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-3) HHH000021: Bytecode provider name : javassist\n08:28:56,359 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-3) HHH000204: Processing PersistenceUnitInfo [\n\tname: dcm4che-jdbc-prefs\n\t...]\n08:28:57,134 INFO  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-3) HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider\n08:28:57,738 INFO  [org.hibernate.dialect.Dialect] (MSC service thread 1-3) HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect\n08:28:57,797 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-3) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory\n08:28:57,824 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-3) HHH000397: Using ASTQueryTranslatorFactory\n08:28:57,937 INFO  [org.hibernate.validator.util.Version] (MSC service thread 1-3) Hibernate Validator 4.2.0.Final\n08:28:58,439 INFO  [org.hibernate.tool.hbm2ddl.SchemaValidator] (MSC service thread 1-3) HHH000229: Running schema validator\n08:28:58,440 INFO  [org.hibernate.tool.hbm2ddl.SchemaValidator] (MSC service thread 1-3) HHH000102: Fetching database metadata\n08:28:58,610 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] (MSC service thread 1-3) HHH000261: Table found: PREFS.ATTRIBUTE\n08:28:58,610 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] (MSC service thread 1-3) HHH000037: Columns: [node, attr_key, attr_value, pk]\n08:28:58,616 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] (MSC service thread 1-3) HHH000261: Table found: PREFS.NODE\n08:28:58,617 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] (MSC service thread 1-3) HHH000037: Columns: [name, parent, pk]\n08:28:58,834 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed \"dcm4che-jdbc-prefs-1.0.0-SNAPSHOT.jar\"\n08:28:58,835 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed \"ojdbc6.jar\"\n...\n```\n\nConfiguration Data Import\n-------------------------\nThe sub-project `dcm4che-jdbc-prefs-tool` provides a script (xmlPrefs2jdbc or xmlPrefs2jdbc.bat) for importing dcm4che compatible DICOM configuration data\ninto the SQL backend. To use the import script, follow these steps:\n* Unzip the file `dcm4che-jdbc-prefs-tool-\u003cversion\u003e-bin.zip`\n* Copy a jdbc driver to the `/dcm4che-jdbc-prefs-tool-\u003cversion\u003e-bin/lib/` directory\n* Open the import script `/dcm4che-jdbc-prefs-tool-\u003cversion\u003e-bin/bin/xmlPrefs2jdbc` (or xmlPrefs2jdbc.bat) in an editor of your choice\n* Change the line  \n    \u003e # JDCB Driver  \n    \u003e CP=\"$CP:$DCM4CHE_HOME/lib/ojdbc6.jar\"  \nto match the jdbc driver imported above\n* Change line  \n   \u003e # JDBC connection properties  \n   \u003e JDBC=\"-Djdbc.prefs.datasource=jdbc:oracle:thin:@localhost:1521:xe\"  \n   \u003e JDBC=\"$JDBC -Djdbc.prefs.connection.username=prefs\"  \n   \u003e JDBC=\"$JDBC -Djdbc.prefs.connection.password=prefs\"   \nto match the username and password for your database connection\n* Run the script: `xmlPrefs2jdbc \u003cxml-file\u003e`\n\nExample:\n\n```\nbin $ ./xmlPrefs2jdbc \u003cpath\u003e/sample-config.xml \n08:46:35,245 INFO  - HCANN000001: Hibernate Commons Annotations {4.0.1.Final}\n08:46:35,252 INFO  - HHH000412: Hibernate Core {4.1.3.Final}\n08:46:35,254 INFO  - HHH000206: hibernate.properties not found\n08:46:35,255 INFO  - HHH000021: Bytecode provider name : javassist\n08:46:35,917 INFO  - HHH000402: Using Hibernate built-in connection pool (not for production use!)\n08:46:36,013 INFO  - HHH000115: Hibernate connection pool size: 20\n08:46:36,013 INFO  - HHH000006: Autocommit mode: true\n08:46:36,014 INFO  - HHH000401: using driver [oracle.jdbc.OracleDriver] at URL [jdbc:oracle:thin:@localhost:1521:xe]\n08:46:36,014 INFO  - HHH000046: Connection properties: {user=prefs, password=****, autocommit=true, release_mode=auto}\n08:46:36,308 INFO  - HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect\n08:46:36,330 INFO  - HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory\n08:46:36,334 INFO  - HHH000397: Using ASTQueryTranslatorFactory\n08:46:36,548 INFO  - HHH000229: Running schema validator\n08:46:36,549 INFO  - HHH000102: Fetching database metadata\n08:46:36,662 INFO  - HHH000261: Table found: PREFS.ATTRIBUTE\n08:46:36,662 INFO  - HHH000037: Columns: [node, attr_key, attr_value, pk]\n08:46:36,668 INFO  - HHH000261: Table found: PREFS.NODE\n08:46:36,668 INFO  - HHH000037: Columns: [name, parent, pk]\nHibernate: select * from ( select node0_.pk as pk0_, node0_.name as name0_, node0_.parent as parent0_ from node node0_ where node0_.name='rootNode' ) where rownum \u003c= ?\nHibernate: select node_pk_seq.nextval from dual\nHibernate: insert into node (name, parent, pk) values (?, ?, ?)\nHibernate: select node0_.pk as pk0_0_, attributes1_.pk as pk1_1_, node0_.name as name0_0_, node0_.parent as parent0_0_, attributes1_.attr_key as attr2_1_1_, attributes1_.node as node1_1_, attributes1_.attr_value as attr3_1_1_, attributes1_.node as node0_0__, attributes1_.pk as pk0__ from node node0_ left outer join attribute attributes1_ on node0_.pk=attributes1_.node where node0_.parent=?\n...\n```\n\nDeveloper Info\n--------------\nTo use dcm4che-jdbc-prefs with your application, you need to set a mapping for the default PreferencesFactory\nto be overridden by the PreferencesFactoryImpl of this project, e.g.:\n```\nSystem.setProperty(\"java.util.prefs.PreferencesFactory\", \"org.dcm4che.jdbc.prefs.PreferencesFactoryImpl\");\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcm4che%2Fdcm4che-jdbc-prefs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcm4che%2Fdcm4che-jdbc-prefs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcm4che%2Fdcm4che-jdbc-prefs/lists"}