Advertisement
Guest User

Untitled

a guest
Nov 1st, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. Utilizando jboss-cli.bat
  2.  
  3. Paso 1. subir el driver a wildfly
  4.  
  5. module add --name=org.postgres94 --resources=/Users/fernando/docs/javaForWeb/lib/postgresql-9.4.1211.jar --dependencies=javax.api,javax.transaction.api
  6.  
  7.  
  8. Paso 2. registrar el driver
  9.  
  10. /subsystem=datasources/jdbc-driver=org.postgres94:add(driver-name="org.postgres94",driver-module-name="org.postgres94",driver-class-name=org.postgresql.Driver)
  11.  
  12. Paso 3. crear el datasource
  13.  
  14. data-source add --jndi-name=java:/DataSourcePostgres --name=DataSourcePostgress --connection-url=jdbc:postgresql://localhost/JavaForWeb --driver-name=org.postgres94 --user-name=postgres --password=sample
  15.  
  16.  
  17.  
  18. Paso 4 cambiar el hibernate.cfg.xml
  19.  
  20. <property name="connection.datasource">java:/DataSourcePostgres</property>
  21.  
  22. <!-- JDBC Database connection settings -->
  23. <!--
  24. <property name="connection.driver_class">org.postgresql.Driver</property>
  25. <property name="connection.url">jdbc:postgresql://localhost:5432/JavaForWeb</property>
  26. <property name="connection.username">postgres</property>
  27. <property name="connection.password">postgres</property>
  28. !-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement