Está en la página 1de 2

NetBeans

-Pestaa Services
*Databases
1. Clic Derecho - New Connection
+ Driver = PosgreSQL
+ Next
//Datos que dependen del servidor
+ Host = localhost
+ Port = 5432
+ Database = bd_noticias
+ User Name = user_java
+ Password = 123456
//
+ Seleccionar Remember password
+ Clic Test Connection
+ Si la conexin se realiz satisfactoriamente dar clic en Next,
de lo contrario verificar los datos ingresados.
+ Select schema = public
+ Next
+ Debe quedar una URL as: jdbc:postgresql://localhost:5432/bd_noticias [user_java
on Default schema]
+ Borrar contenido en corchetes para quedar as jdbc:postgresql://localhost:5432/b
d_noticias
-Proyecto ServicioNoticias
2. Clic Derecho - New - Other
+ Buscar y seleccionar categora Glassfish
+ Buscar y seleccionar JDBC Connection Pool en la casilla File Types
+ Next
+ JDBC Connection Pool Name = bdNoticiasPool
+ Extract from Existing Connection = jdbc:postgresql://localhost:5432/bd_noticia
s [user_java on public]
//Agregar las siguientes propiedades (Add) --Datos dependen de la configuracin de
l servidor
+ serverName = localhost
+ databaseName = bd_noticias
+ portNumber = 5432
//
+ Next
+ Finish
-Proyecto ServicioNoticias
3. Clic Derecho - New + Buscar y seleccionar categora Glassfish
+ Buscar y seleccionar JDBC Resource en la casilla File Types
+ Use Existing JDBC Connection Pool = bdNoticiasPool
+ JNDI Name = jdbc/bd_noticias
+ Finish
-Proyecto ServicioNoticias
4. Clic Derecho - New - Other
+ Buscar y seleccionar categora Persistence
+ Buscar y seleccionar Entity Classes from Database en la casilla File Types
+ Next
+ Data Source = jdbc/bd_noticias
+ Add All >>
+ Next
+ Package = com.servicionoticias.models
+ Finish

También podría gustarte