Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Context>
  3. <WatchedResource>WEB-INF/web.xml</WatchedResource>
  4. <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
  5. <!-- Deixa a conexão com o banco a cargo do container -->
  6. <Resource name="jdbc/gymclub" auth="Container" type="javax.sql.DataSource"
  7. maxActive="100" maxIdle="30" maxWait="10000"
  8. username="admin" password="123456" driverclassname="org.postgresql.Driver"
  9. url="jdbc:postgresql://localhost:5432/gymclub"/>
  10. </Context>
  11.  
  12. <resource-ref>
  13. <description>postgreSQL Datasource example</description>
  14. <res-ref-name>jdbc/gymclub</res-ref-name>
  15. <res-type>javax.sql.DataSource</res-type>
  16. <res-auth>Container</res-auth>
  17. </resource-ref>
  18.  
  19. <?xml version="1.0" encoding="UTF-8"?>
  20. <persistence version="2.1"
  21. xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  22. xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
  23. <persistence-unit name="gymclub">
  24. <provider>org.hibernate.ejb.HibernatePersistence</provider>
  25. <!-- Deixa o controle de conexão com o banco a cargo do container. -->
  26. <non-jta-data-source>java:/comp/env/jdbc/gymclub</non-jta-data-source>
  27. <!-- Habilita cache de segundo nivel <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode> -->
  28. <properties>
  29. <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL9Dialect" />
  30. <!-- False no ambiente de produção -->
  31. <property name="hibernate.show_sql" value="true" />
  32. <property name="hibernate.format_sql" value="true" />
  33. <!-- None no ambiente de produção -->
  34. <property name="hibernate.hbm2ddl.auto" value="update" />
  35. <!-- Essa propriedade permite que as sequences sejam criadas com os valores
  36. iniciais que são especificados no domínio. -->
  37. <property name="hibernate.id.new_generator_mappings" value="true" />
  38. <!-- Cache de segundo nivel do hibernate <property name="hibernate.cache.region.factory_class"
  39. value="org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory" /> -->
  40. </properties>
  41. </persistence-unit>
  42.  
  43. Cannot create JDBC driver of class '' for connect URL 'null'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement