• Save
Desenvolupament d’aplicacions web (DAW) - UF2 - Act4
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Desenvolupament d’aplicacions web (DAW) - UF2 - Act4

on

  • 324 views

 

Statistics

Views

Total Views
324
Views on SlideShare
324
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Desenvolupament d’aplicacions web (DAW) - UF2 - Act4 Presentation Transcript

  • 1. UF2 – Act4Servidor d’aplicacions Glassfish – JDBC Realm Laia Luna – IES Milà i Fontanals
  • 2. Instal·lació de JDK# sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"# sudo apt-get update# sudo apt-get install sun-java6- jdk sun-java6-jre
  • 3. Variables entorn Aquestes variables permetran que el Glassfish pugui accedir al Derbi.#sudo nano /opt/glassfishv3/glassfish/config/asenv.conf JAVA_HOME=/usr/lib/jvm/java-6-openjdk AS_JAVA=/usr/lib/jvm/java-6-openjdk Per a saber els dominis creats:
  • 4. JavaDBPaquets#sudo apt-get install sun-javadb-client sun-javadb-core#sudo apt-get update# exportCLASSPATH=$DERBY_INSTALL/lib/derby.jar:$DERBY_INSTALL/lib/derbytools.jar:.# export DERBY_INSTALL=/opt/Apache/db-derby-10.9.1.0-bin
  • 5. JavaDB# export PATH=$PATH:/usr/share/javadb/bin/# export DERBY_HOME=/usr/share/javadb# sudo apt-get install connect-proxy Engegar base de dades amb:# sudo /opt/glassfishv3/bin/asadmin start- databasehttp://www.stuartellis.eu/articles/derby-javadb/
  • 6. Connection PoolAl navegador: www.from8080.local:4848JDBC > Connection PoolAquí estem lligant la BD amb el JDBC. El “userauth” és el lligam.
  • 7. JDBC ResourceAquí configurem dins del “userauth” la base de dades (POOLNAME)
  • 8. JDBC RealmConfiguration > Segurity > Realms. Crear-ne un denou.
  • 9. JDBC Realm
  • 10. JavaDB• Per connectar-nos a IJ de Derby:# ij> connectjdbc:derby://localhost:1527/userauth;user=APP;password=APP;create=TRUE;> connectjdbc:derby://localhost:1527/userauth;user=APP;password=APP;> run scriptsql;
  • 11. Arbre de directoris APPFer un projecte JAVA-WEB : Glassfish-web.xml apartir de Glassfish 3.1
  • 12. WEB.XMLQuan tinguem creat el projecte en el Netbeans, botódret:Nuevo > Otro > Web > Standart Deployment Descriptor (web.xml)
  • 13. GLASSFISH-WEB.XMLgroup -> base de dades (GROUPTABLE) role -> glassfish (web.xml)
  • 14. Execució
  • 15. GUIES Glassfish: http://www.nabisoft.com/tutorials/glass fish/installing-glassfish-311-on-ubuntu Database i Realm: http://blogs.oracle.com/foo/entry/mort_ learns_jdbc_realm_authentication ConnectionPool i JDBC Resource http://blogs.oracle.com/foo/entry/mort_ learns_jdbc_for_glassfish