云梦网站开发,会昌县 两学一做 网站,软件培训教程,开发一个app平台大概需要多少钱?Open Liberty是源自WebSphere Liberty的有趣的新型OSS Java EE应用服务器。 您可以将Open Liberty配置为使用PostgreSQL作为其默认数据源#xff0c;如下所示#xff1a; 将datasource #xff0c; jdbcDriver和library指令添加到server.xml配置中… Open Liberty是源自WebSphere Liberty的有趣的新型OSS Java EE应用服务器。 您可以将Open Liberty配置为使用PostgreSQL作为其默认数据源如下所示 将datasource jdbcDriver和library指令添加到server.xml配置中 ?xml version1.0 encodingUTF-8?
server descriptionOpenLiberty Java EE 8 ServerfeatureManagerfeaturejavaee-7.0/feature/featureManagerhttpEndpoint iddefaultHttpEndpoint host* httpPort9080 httpsPort9443/keyStore iddefaultKeyStore passwordLiberty/!-- Postgres coffee-shop-db definition --dataSource idDefaultDataSourcejndiNamejdbc/samplejdbcDriverRefpostgresql-drivertypejavax.sql.ConnectionPoolDataSourcetransactionaltrueproperties serverNamecoffee-shop-dbportNumber5432databaseNamepostgresuserpostgrespasswordpostgres//dataSourcejdbcDriver idpostgresql-driverjavax.sql.XADataSourceorg.postgresql.xa.PGXADataSourcejavax.sql.ConnectionPoolDataSourceorg.postgresql.ds.PGConnectionPoolDataSourcelibraryRefpostgresql-library/library idpostgresql-libraryfileset idPostgreSQLFileset dir/opt/ol/wlp/libincludespostgresql-9.4-1201.jar//library/server 通过主机coffee-shop-db可用coffee-shop-db将通过默认的Postgres端口5432使用postgres作为数据库名称用户名和密码访问。 驱动程序库这里为postgresql-9.4-1201.jar 需要驻留在服务器安装的lib/目录中。 可以从Java EE应用程序透明地使用默认数据源。 在persistence.xml文件中只需指定一个持久性单元类似于以下代码片段 ?xml version1.0 encodingUTF-8?
persistence version2.1 xmlnshttp://xmlns.jcp.org/xml/ns/persistencexmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://xmlns.jcp.org/xml/ns/persistencehttp://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsdpersistence-unit nameprod transaction-typeJTA//persistence 如果应用程序包含多个数据库则要求持久性单元指定其相应数据源的JNDI名称。 经过官方Docker镜像open-liberty:javaee7 。 翻译自: https://www.javacodegeeks.com/2018/01/postgresql-open-liberty.html