Thursday, September 24, 2009

Why Do My Gums Feel Swollen?

JSP with Hibernate JPA hibernate Framework datasource in netbeans

want to give an introduction and simple example of how
implement this technology, simpre
recommend reading a bit, because if we do not give pure juice
trying to implement these technologies.

http://ubuntulife.wordpress.com/2008/10/20/introduccion-a-jpa-java-persistence-api/
http://www.slideshare.net/jamslug/introduccin-a- java-persistence-api
http://www.softwarelibre.net/ibatis_hibernate_y_jpa_% C2% BFcu% C3% A1l_es_el_que_tu_necesitas
http://www.roseindia.net/software-tutorials/detail/24071
http://www.roseindia.net/tutorialsearch/?t=jpa&image.x=0&image.y=0 good

on the following link is an example
very good but with ejb
http://nachxs.wordpress.com/2009/04/28/tutorial-ejb-persistencia-y-postgresql-en-netbeans-65/

but I'm going to do without an ejb

1: In our project web

2:
3:
then next, next

4: In our new servlet

Now we have this core code

in this code we enter data into our database

-> into your servlet enter the following code

e = new Company Company ();

e.setNombre ("best");
e.setDireccion ("Santiago");
e.setRut ("1111");
persist (e) / / call our code above

remember that entities are representations of type beans
our tables in our data base

and finally to retrieve information we must take in order
Query q = em.createNativeQuery ....
this whole process is very similar to code shown in the photo
and to traverse the collection deal

List

Tuesday, September 22, 2009

Open Prestolock Search Alert

in connection

well this example is very similar to one made with a servlet,
but has some differences, the steps are




as always a link to help us better understand

datasource http://java.sun.com/j2se/1.4.2/docs/guide/jdbc/getstart/datasource.html
http://doc.postgresintl. com/jdbc/ch11.html
http://tomcat.apache.org/tomcat-4.1-doc/jndi-datasource-examples-howto.html
http://java.sun.com/j2se/ 1.4.2/docs/api/javax/sql/DataSource.html

Best Model Haans Steam Mop

BD jsp jsp and eclipse IDE

well this is the connection that corresponds to the J2SE platform and is the easiest
, but it is the most recommended for j2ee, since
for many simultaneous connections, performs very slow
but could be improved with a design pattern as a singleton
, generally implemented as a desktop application in java
, the idea would occupy propierdades
we provide the web container, which we can provide a connection
pool type. (How a connection pool
explain it in a previous article)

for an application of a few connections 3, 5 or 7
the following example I think that may be good, and most importantly
does not have a major impact of moving from J2SE to J2EE.

<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>

html


head / head body

postgres connection h1 / h1
<%


try {String connectionURL = "jdbc: postgresql: / / localhost / example";

Connection connection = null;
Class.forName ("org.postgresql.Driver"). newInstance ();
connection = DriverManager.getConnection (connectionURL, "postgres", "1234");
connection.createStatement
Statement stat = ();
unsql String = "select * from company" ResultSet
stat.executeQuery response = (unsql)

while (respuesta.next ()) {

out.println ("" + respuesta.getString ("name"));}

respuesta.close ();
stat.close ();
Connection.Close ();
} catch (Exception e) {

out.println ("/ database connection error");}

%>
/ body / html

eye I have no tags with <> to keep me from
problem

blog can be seen that the connection is the same deal in
J2SE, but do not worry, because in a previous article
explain how to generate a pool in a servlet, but now in the following article explain how
do it in a jsp (I think I have an example
JSTL, JSTL technology but is not my favorite, I'd rather JSF, Struts and Spring) a contribution to java