Configure ingress in as an Oracle connection

Source: Internet
Author: User
Main Environment: JBOSS5.1.0Orace10GGatein3.1.0

Main Environment: JBOSS 5.1.0 release E 10G Release in3.1.0-GA reference the original article in the release in official user manual, and briefly translate and annotate it.

Main Environment:
JBOSS 5.1.0

Orace 10G

Gatein3.1.0-GA

Refer to the original article in the movie in official user manual and briefly translate and annotate it:
2.1. Database Configuration
2.1.1. Overview
Dependencies in 3.1 has two different database dependencies. one is the identity service configuration, which depends on Hibernate. the other is Java content repository (JCR) service, which depends on jdbc api, and can integrate with any existing datasource implementation.

When you change the database configuration for the first time, wait in will automatically generate the proper schema (assuming that the database user has the appropriate permissions ).

Instances in 3.1 assumes the default encoding for your database is latin1. You may need to change this parameter for your database in order for instances in 3.1 to work properly.

Summary: mongoin depends on two databases. One database is used for identity authentication and Hibernate is used. The other one is used to support JCR. JDBC APIs can be used to support any existing database. After you change the database configuration for the first time, mongoin will automatically generate a schema (annotation: the database solution, such as tables and views) (your database users must have these permissions) gateIn3.1 assuming that your database encoding method is latin1, you may need to change the encoding method of your database to make ipv3.1 work normally (Note: latin1 is ISO8859-1 encoding, this seems to be a commonly used mySql encoding method, I did not have this encoding method when I set up the Oracle database, I use a UTF-8, this is a wide character set, should be compatible, no problem has been found yet) 2.1.2. refreshing the database for JCR
To configure the database used by JCR you will need to edit the file:

$ JBOSS_HOME/server/default/conf/logs in/configuration. propertiesFor Tomcat, the file is located

$ TOMCAT_HOME/logs in/conf/configuration. propertiesAnd edit the values of driver, url, username and password with the values for your JDBC connection (please, refer to your database JDBC driver documentation ).


Login in. jcr. datasource. driver = org. hsqldb. jdbcDriver
Login in. jcr. datasource. url = jdbc: hsqldb: file :$ {login in. db. data. dir}/data/jdbcjcr _ $ {name}
Login in. jcr. datasource. username = sa
Login in. jcr. datasource. password =
By default, the name of the database is "jdbcjcr _ $ {name}"-$ {name} shocould be a part of the database name, as it is dynamically replaced by the name of the portal container extension (for instance, gatein-sample-portal.ear defines "sample-portal" as container name and the default portal defines "portal" as container name ).

In the case of HSQL the databases are created automatically. for any other database you will need to create a database named jdbcjcr_portal (and "jdbcjcr_sample-portal" if you have gatein-sample-portal.ear in $ JBOSS_HOME/server/default/deploy-note that some databases don't accept '-' in the database name, so you may have to remove $ JBOSS_HOME/server/default/deploy/gatein-sample-portal.ear)

Make sure the user has rights to create tables on jdbcjcr_portal, and to update them as they will be automatically created during the first startup.

Also add your database's JDBC driver into the classpath-you can put it in $ JBOSS_HOME/server/default/lib (or $ TOMCAT_HOME/lib, if you are running on Tomcat)

MySQL example:

Let's configure our JCR to store data in MySQL. let's pretend we have a user named "Login inuser" with a password "Login inpassword ". we wocould create a database "my‑indb_portal" (remember that _ portal is required), and assign our user the rights to create tables.

Then we need to add MySQL's JDBC driver to the classpath, and finally edit tables in. ear/02portal. war/WEB-INF/conf/jcr-configuration to contain the following:

Login in. jcr. datasource. driver = com. mysql. jdbc. Driver
Login in. jcr. datasource. url = jdbc: mysql: // localhost: 3306/mydomainindb $ {container. name. suffix}
Login in. jcr. datasource. username = login inuser
Login in. jcr. datasource. password = login inpassword
2.1.2. JCR Database configuration Modification configuration file: JBOSS: $ JBOSS_HOME/server/default/conf/logs in/configuration. propertiesTomcat: $ atat_home/exist in/conf/configuration. properties: Modify the driver, url, user name, and password, for example, drivers in. jcr. datasource. driver = org. hsqldb. jdbcDriver
Login in. jcr. datasource. url = jdbc: hsqldb: file :$ {login in. db. data. dir}/data/jdbcjcr _ $ {name}
Login in. jcr. datasource. username = sa
Login in. jcr. datasource. password =

... Omitted its own default configuration method, focusing on the next section .....
When the database is HSQL, mongoin automatically creates a database, but if it is another database, you must manually create a database named "jdbcjcr_portal ".
(Note: according to the previous section, the database name must end with _ portal, but for the sake of safety, I have created the Global Database Name of oracle AS jdbcjcr_portal,
I have re-installed oracle for this. I don't know if I just want to create a schema named jdbcjcr_portal, but I don't know if I can. Please try again)
(You also need to create a database named "jdbcjcr_sample-portal", which is used in an example of a named in, but some databases do not support "-" named database,
Then delete this example at $ JBOSS_HOME/server/default/deploy/gatein-sample-portal.ear)
(Note: I killed this ear directly, which is simple and convenient)

Make sure that your database users have the permission to create tables. To test your database driver to $ JBOSS_HOME/server/default/lib ($ TOMCAT_HOME/lib if you use Tomcat), an example of mysql is provided: Login in. jcr. datasource. driver = com. mysql. jdbc. driver
Login in. jcr. datasource. url = jdbc: mysql: // localhost: 3306/mydomainindb $ {container. name. suffix}
Login in. jcr. datasource. username = login inuser
Login in. jcr. datasource. password = login inpassword
My
Setting in. jcr. config. type = local
Runtime in. jcr. datasource. name = java: jdbcjcr
Parameters in. jcr. datasource. dialect = auto
Login in. jcr. datasource. driver = oracle. jdbc. driver. OracleDriver
Login in. jcr. datasource. url = jdbc: oracle: thin: @ 192.168.0.200: 1521: dgoral
Login in. jcr. datasource. username = jdbcjcr_portal
Login in. jcr. datasource. password = XXXX
2.1.3. Locking ing the database for the default identity store
By default, users are stored in a database. To change the database in which to store users, you will need to edit the file:

$ JBOSS_HOME/server/default/conf/logs in/configuration. propertiesFor Tomcat, the file is located

$ TOMCAT_HOME/found in/conf/configuration. propertiesYou will find the same kind of configuration as in jcr-configuration.xml:

Login in. idm. datasource. driver = org. hsqldb. jdbcDriver
Login in. idm. datasource. url = jdbc: hsqldb: file :$ {login in. db. data. dir}/data/jdbcidm _ $ {name}
Login in. idm. datasource. username = sa
Stored in. idm. datasource. password2.1.3. configure the Identity Authentication database or the above configuration file: JBOSS: $ JBOSS_HOME/server/default/conf/login in/configuration. propertiesTomcat: $ atat_home/exist in/conf/configuration. properties example: (annotation: this is the same library as the one used above. paste the post on it.) exist in. idm. datasource. driver = org. hsqldb. jdbcDriver
Login in. idm. datasource. url = jdbc: hsqldb: file :$ {login in. db. data. dir}/data/jdbcidm _ $ {name}
Login in. idm. datasource. username = sa
Login in. idm. datasource. password
My
# IDM
Login in. idm. datasource. name = java: jdbcidm
Login in. idm. datasource. driver = oracle. jdbc. driver. OracleDriver
Login in. idm. datasource. url = jdbc: oracle: thin: @ 192.168.0.200: 1521: dgoral
Login in. idm. datasource. username = jdbcjcr_porta
Login in. idm. datasource. password = XXXX

After reading the above, you can basically get it done. For more information, I don't know much about Oracle. the sid of oracle cannot contain "_", but the global database name can. However, the sid must be written in the Link url, the database name cannot be written. If you have knowledge about oracle, please give us some advice.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.