IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Struts 1 Java Discussion :

struts et base de donnees


Sujet :

Struts 1 Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Inscrit en
    Août 2007
    Messages
    13
    Détails du profil
    Informations forums :
    Inscription : Août 2007
    Messages : 13
    Par défaut struts et base de donnees
    Salut tout le monde,
    Je travaille avec eclipse 3.1,struts, hibernate et MySql, et je veux inserer les donnees d'un formulaire dans la base de donnees.
    Voici les fichiers que j'utilise:

    Formulaire.jsp:
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    <%@ page contentType="text/html; charset=Cp1256" %>
    <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
    <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="/tags/struts-nested" prefix="nested" %>
     
    <html:html>
    	<head>
    		<meta http-equiv="Content-Type" content="text/html; charset=Cp1256"/>
    		<title></title>
    	<script language="JavaScript">
    		function ajouter() {
    			document.forms[0].submit();
    		}
    	</script>		
    	</head>
    	<body>
    		<html:form method="POST" action="/Confirm">
    		<bean:message key="projet.message"/>
    		<br>
    		<html:text property="prenom"></html:text>
    		<br>
    		<html:text property="nom"></html:text>
    		<br>
    		<html:button property="confirmer" value="Confirmer" onclick="ajouter();"></html:button>
    		</html:form>
    	</body>
    </html:html>

    Succes.jsp:
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    <%@ page contentType="text/html; charset=Cp1256" %>
    <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
    <%@ taglib uri="/tags/struts-logic" prefix="logic" %>
    <%@ taglib uri="/tags/struts-html" prefix="html" %>
    <%@ taglib uri="/tags/struts-nested" prefix="nested" %>
     
    <html:html>
    	<head>
    		<meta http-equiv="Content-Type" content="text/html; charset=Cp1256"/>
    		<title></title>
    	</head>
    	<body>
    		<html:form method="POST" action="/resultat">
    		Succes
    		<%
    		String nom=(String)request.getParameter("nom");
    		String prenom=(String)request.getParameter("prenom");
    		%>
    		<br>
    		Nom : <%=nom%>
    		<br>
    		Prenom : <%=prenom%>
    		</html:form>
    	</body>
    </html:html>

    FormulaireForm.java:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    package src;
     
    import org.apache.struts.action.ActionForm;
     
    public class FormulaireForm extends ActionForm{
     
    	/**
             * 
             */
    	private static final long serialVersionUID = 1L;
    	private String nom;
    	private String prenom;
     
    	public FormulaireForm(){
     
    	}
    	public String getNom(){
    		return nom;
    	}
    	public void setNom(String nom){
    		nom=this.nom;
    	}
    	public String getPrenom(){
    		return prenom;
    	}
    	public void setPrenom(String prenom){
    		prenom=this.prenom;
    	}
    	/*public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
            ActionErrors errors = new ActionErrors();
            if (getNom() == null || getPrenom()==null) {
             FormulaireForm f=new FormulaireForm();
             request.setAttribute("FormulaireForm",f);
                errors.add("name", new ActionMessage("error.name.required"));
                // TODO: add 'error.name.required' key to your resources
            }
            else {
            	System.out.println("Le nom est:"+getNom());
            	System.out.println("Le prenom est:"+getPrenom());
            }
            return errors;
        }*/
     
    }
    FormulaireAction.java:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    package src;
     
    import metier.AjoutOrphelin;
     
    import org.apache.struts.action.Action;
    import java.io.IOException;
     
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionForm;
     
    public class FormulaireAction extends Action{
    	public ActionForward execute(ActionMapping mapping, ActionForm form,
    			HttpServletRequest request, HttpServletResponse response)
    			throws IOException, ServletException {
    		FormulaireForm f=(FormulaireForm)form;
    		String nom=f.getNom();
    		String prenom=f.getPrenom();
    		System.out.println("Le prenom est "+prenom);
    		System.out.println("Le nom est "+nom);
    		//request.setAttribute("nom",nom);
    		//request.setAttribute("prenom",prenom);
    		AjoutOrphelin ajout=new AjoutOrphelin(f,request);
    		ajout.Ajout();
    		return (mapping.findForward("resultat"));
     
    	}
     
    }
    Orphelin.java:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    package donnees;
     
    import donnees.base.BaseOrphelin;
     
     
     
    public class Orphelin extends BaseOrphelin {
    	private static final long serialVersionUID = 1L;
     
    /*[CONSTRUCTOR MARKER BEGIN]*/
    	public Orphelin () {
    		super();
    	}
     
    	/**
             * Constructor for primary key
             */
    	public Orphelin (java.lang.Integer id) {
    		super(id);
    	}
     
    	/**
             * Constructor for required fields
             */
    	public Orphelin (
    		java.lang.Integer id,
    		java.lang.String nomOrphelin,
    		java.lang.String prenomOrphelin) {
     
    		super (
    			id,
    			nomOrphelin,
    			prenomOrphelin);
    	}
     
    /*[CONSTRUCTOR MARKER END]*/
     
     
    }
    BaseOrphelin.java:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    package donnees.base;
     
    import java.io.Serializable;
    import java.util.HashSet;
    import java.util.Set;
     
     
    /**
     * This is an object that contains data related to the orphelin table.
     * Do not modify this class because it will be overwritten if the configuration file
     * related to this class is modified.
     *
     * @hibernate.class
     *  table="orphelin"
     */
     
    public abstract class BaseOrphelin  implements Serializable {
     
    	public static String REF = "Orphelin";
    	public static String PROP_NOM_ORPHELIN = "NomOrphelin";
    	public static String PROP_PRENOM_ORPHELIN = "PrenomOrphelin";
    	public static String PROP_ID = "Id";
     
     
    	// constructors
    	public BaseOrphelin () {
    		initialize();
    	}
     
    	/**
             * Constructor for primary key
             */
    	public BaseOrphelin (java.lang.Integer id) {
    		this.setId(id);
    		initialize();
    	}
     
    	/**
             * Constructor for required fields
             */
    	public BaseOrphelin (
    		java.lang.Integer id,
    		java.lang.String nomOrphelin,
    		java.lang.String prenomOrphelin) {
     
    		this.setId(id);
    		this.setNomOrphelin(nomOrphelin);
    		this.setPrenomOrphelin(prenomOrphelin);
    		initialize();
    	}
     
    	protected void initialize () {}
     
     
     
    	private int hashCode = Integer.MIN_VALUE;
     
    	// primary key
    	private java.lang.Integer id;
     
    	// fields
    	private java.lang.String nomOrphelin;
    	private java.lang.String prenomOrphelin;
     
    	// collections
    	//private java.util.Set<orph_package.Garant> garants;
    	private Set garants = new HashSet();
    	public Set getGarants() {
    	return garants;
    	}
    	public void setGarants(Set garants) {
    	this.garants = garants;
    	}
     
     
     
    	/**
             * Return the unique identifier of this class
         * @hibernate.id
         *  generator-class="increment"
         *  column="ID_orphelin"
         */
    	public java.lang.Integer getId () {
    		return id;
    	}
     
    	/**
             * Set the unique identifier of this class
             * @param id the new ID
             */
    	public void setId (java.lang.Integer id) {
    		this.id = id;
    		this.hashCode = Integer.MIN_VALUE;
    	}
     
     
     
     
    	/**
             * Return the value associated with the column: nom_orphelin
             */
    	public java.lang.String getNomOrphelin () {
    		return nomOrphelin;
    	}
     
    	/**
             * Set the value related to the column: nom_orphelin
             * @param nomOrphelin the nom_orphelin value
             */
    	public void setNomOrphelin (java.lang.String nomOrphelin) {
    		this.nomOrphelin = nomOrphelin;
    	}
     
     
     
    	/**
             * Return the value associated with the column: prenom_orphelin
             */
    	public java.lang.String getPrenomOrphelin () {
    		return prenomOrphelin;
    	}
     
    	/**
             * Set the value related to the column: prenom_orphelin
             * @param prenomOrphelin the prenom_orphelin value
             */
    	public void setPrenomOrphelin (java.lang.String prenomOrphelin) {
    		this.prenomOrphelin = prenomOrphelin;
    	}
     
     
     
    	/**
             * Return the value associated with the column: Garants
             */
    	/*public java.util.Set<orph_package.Garant> getGarants () {
    		return garants;
    	}
    */
    	/**
             * Set the value related to the column: Garants
             * @param garants the Garants value
             */
    	/*public void setGarants (java.util.Set<orph_package.Garant> garants) {
    		this.garants = garants;
    	}
     
    	public void addToGarants (orph_package.Garant garant) {
    		if (null == getGarants()) setGarants(new java.util.TreeSet<orph_package.Garant>());
    		getGarants().add(garant);
    	}
    */
     
     
     
    	public boolean equals (Object obj) {
    		if (null == obj) return false;
    		if (!(obj instanceof donnees.Orphelin)) return false;
    		else {
    			donnees.Orphelin orphelin = (donnees.Orphelin) obj;
    			if (null == this.getId() || null == orphelin.getId()) return false;
    			else return (this.getId().equals(orphelin.getId()));
    		}
    	}
     
    	public int hashCode () {
    		if (Integer.MIN_VALUE == this.hashCode) {
    			if (null == this.getId()) return super.hashCode();
    			else {
    				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
    				this.hashCode = hashStr.hashCode();
    			}
    		}
    		return this.hashCode;
    	}
     
     
    	public String toString () {
    		return super.toString();
    	}
     
     
    }
    HibernateUtil.java:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    package donnees;
    import org.hibernate.HibernateException;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.cfg.Configuration;
     
    public class HibernateUtil {
    	private static final SessionFactory sessionFactory;
    	static {
    		try {
    			// Crée la SessionFactory
    			sessionFactory = new Configuration().configure().buildSessionFactory();
    		} catch (HibernateException ex) {
    			throw new RuntimeException("Problème de configuration : " + ex.getMessage(), ex);
    		}}
    	public static final ThreadLocal session = new ThreadLocal();
    	public static Session currentSession() throws HibernateException {
    		Session s = (Session) session.get();
    		// Ouvre une nouvelle Session, si ce Thread n'en a aucune
    		if (s == null) {
    			s = sessionFactory.openSession();
    			session.set(s);
    		}
    		return s;
    	}
    	public static void closeSession() throws HibernateException {
    		Session s = (Session) session.get();
    		session.set(null);
    		if (s != null)
    			s.close();
    		}
    	}

    Lorsque je fais le test d'ajout sans passer par struts, l'insertion dans la base de donnees se fait parfaitement.
    et lorsque je travaille avec struts sans base de donnees, j'arrive a afficher les valeurs saisies a partir du formulaire dans la page "succes.jsp".
    Le probeleme se pose lorsque je travaille avec les deux. Deja, avec le debuggage, j'ai decouvert que les valeurs getPrenom() et getNom() dans FormulaireAction sont nulles.
    En plus, il me declare une erreur qu'il ne connait pas la methode Ajout().
    Est ce que qlq peut me dire si la facon avec laquelle je procede est correcte. sinon, c koi la solution du probleme. Merci d'avance.

  2. #2
    Membre expérimenté Avatar de CaptainCyd
    Inscrit en
    Avril 2007
    Messages
    201
    Détails du profil
    Informations personnelles :
    Âge : 46

    Informations forums :
    Inscription : Avril 2007
    Messages : 201
    Par défaut


    tu peux poster aussi des config xml stp :
    - web.xml
    - struts-config.xml
    - le fichier xml pour hibernate

    C'est quoi tes versions de :
    - struts
    - ton conteneur de servlet (tomcat, jboss, autre)
    - version d'hibernate

    Il y a aussi un tuto bien fait sur struts et l'accès aux données
    - http://tahe.developpez.com/
    - http://tahe.developpez.com/java/jpa/

    @+

  3. #3
    Membre averti
    Inscrit en
    Août 2007
    Messages
    13
    Détails du profil
    Informations forums :
    Inscription : Août 2007
    Messages : 13
    Par défaut
    Salut CaptainCyd,
    désolée pour le retard. voici les fichiers xml:

    struts-config:
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
      <?xml version="1.0" ?> 
      <!DOCTYPE struts-config (View Source for full doctype...)> 
    - <struts-config>
      <data-sources /> 
    - <form-beans>
      <form-bean name="FormulaireForm" type="src.FormulaireForm" /> 
      </form-beans>
      <global-exceptions /> 
      <global-forwards /> 
    - <action-mappings>
    - <action path="/Confirm" name="FormulaireForm" scope="request" type="src.FormulaireAction">
      <forward name="resultat" path="/jsp/resultat.jsp" /> 
      </action>
      <action path="/resultat" name="FormulaireForm" parameter="/jsp/resultat.jsp" type="org.apache.struts.actions.ForwardAction" /> 
      </action-mappings>
      <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor" /> 
      <message-resources parameter="MessageResources" /> 
    - <plug-in className="org.apache.struts.tiles.TilesPlugin">
      <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" /> 
      <set-property property="moduleAware" value="true" /> 
      </plug-in>
    - <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
      <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" /> 
      </plug-in>
      </struts-config>
    hibernate.cfg.xml:
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE hibernate-configuration
        PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
     
    <hibernate-configuration>
        <session-factory >
     
    		<!-- local connection properties -->
    		<property name="hibernate.connection.url">jdbc:mysql://localhost/amal</property>
    		<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    		<property name="hibernate.connection.username">root</property>
    		<property name="hibernate.connection.password">ammoula</property>
    		<!-- property name="hibernate.connection.pool_size"></property -->
     
    		<!-- dialect for MySQL -->
            <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
     
            <property name="hibernate.show_sql">false</property>
            <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
        </session-factory>
    </hibernate-configuration>
    web.xml:
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    <?xml version="1.0" encoding="Shift_JIS"?>
     
    <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">
     
    <web-app>
      <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <init-param>
          <param-name>debug</param-name>
          <param-value>2</param-value>
        </init-param>
        <init-param>
          <param-name>detail</param-name>
          <param-value>2</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
      </servlet>
     
      <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
      </servlet-mapping>
     
      <taglib>
        <taglib-uri>/tags/struts-bean</taglib-uri>
        <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
      </taglib>
     
      <taglib>
        <taglib-uri>/tags/struts-html</taglib-uri>
        <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
      </taglib>
     
      <taglib>
        <taglib-uri>/tags/struts-logic</taglib-uri>
        <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
      </taglib>
     
      <taglib>
        <taglib-uri>/tags/struts-nested</taglib-uri>
        <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
      </taglib>
     
      <taglib>
        <taglib-uri>/tags/struts-tiles</taglib-uri>
        <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
      </taglib>
     
      <!--
      <taglib>
        <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
        <taglib-location>/WEB-INF/c.tld</taglib-location>
      </taglib>
     
      <taglib>
        <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
        <taglib-location>/WEB-INF/fmt.tld</taglib-location>
      </taglib>
     
      <taglib>
        <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
        <taglib-location>/WEB-INF/sql.tld</taglib-location>
      </taglib>
     
      <taglib>
        <taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
        <taglib-location>/WEB-INF/x.tld</taglib-location>
      </taglib>
      -->
    </web-app>

    orphelin.hbm.xml:
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
    	"-//Hibernate/Hibernate Mapping DTD//EN"
    	"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
     
    <hibernate-mapping package="donnees">
    	<class
    		name="Orphelin"
    		table="orphelin"
    	>
    		<meta attribute="sync-DAO">false</meta>
    		<id
    			name="Id"
    			type="integer"
    			column="ID_orphelin"
    		>
    			<generator class="sequence"/>
    		</id>
     
    		<property
    			name="NomOrphelin"
    			column="nom_orphelin"
    			type="string"
    			not-null="true"
    			length="45"
    		/>
    		<property
    			name="PrenomOrphelin"
    			column="prenom_orphelin"
    			type="string"
    			not-null="true"
    			length="45"
    		/>
     
    		<set
    			name="Garants"
    			table="garant_orphelin"
    			cascade="all"
    		>
    			<key column="Id_Orphelin"/>
    			<many-to-many column="Id_Garant" class="Garant"/>
    		</set>
     
     
    	</class>	
    </hibernate-mapping>
    j'ai deja decouvert un probleme dans FormulaireForm: dans les setters au lieu de mettre this.nom=nom, je faisais nom=this.nom, c pourquoi, les valeurs etaient nulles.
    Maintenant il me declare l'erreur suivante: /hibernate.cfg.xml not found.
    merci bcp pour ton aide.

  4. #4
    Membre expérimenté Avatar de CaptainCyd
    Inscrit en
    Avril 2007
    Messages
    201
    Détails du profil
    Informations personnelles :
    Âge : 46

    Informations forums :
    Inscription : Avril 2007
    Messages : 201
    Par défaut
    j'ai deja decouvert un probleme dans FormulaireForm: dans les setters au lieu de mettre this.nom=nom, je faisais nom=this.nom, c pourquoi, les valeurs etaient nulles.
    tip top

    Maintenant il me declare l'erreur suivante: /hibernate.cfg.xml not found.
    Pour ton fichier hibernate.cfg.xml, est-ce qu'il est bien dans le répertoire src de ton appli ?
    tuto sur hibernate

    Quand tu mets un code source sur un post, pense à utiliser les balise CODE
    C'est le bouton # sur l'editeur de message.

    C'est plus facile pour lire

  5. #5
    Membre averti
    Inscrit en
    Août 2007
    Messages
    13
    Détails du profil
    Informations forums :
    Inscription : Août 2007
    Messages : 13
    Par défaut
    Salut CaptainCyd,
    Desolee pour le retard encore une fois. Bon, le fichier hibernate.cfg.xml n'etait vraiment pas dans le dossier src. Maintenant ca marche bien.
    Merci bcp pour ton aide precieuse. Et merci aussi pour ton conseil concernant les balises du code

  6. #6
    Membre expérimenté Avatar de CaptainCyd
    Inscrit en
    Avril 2007
    Messages
    201
    Détails du profil
    Informations personnelles :
    Âge : 46

    Informations forums :
    Inscription : Avril 2007
    Messages : 201
    Par défaut
    heureux d'avoir pu t'aider

    Pense au si ce n'est pas déjà fait

    @+

Discussions similaires

  1. Réponses: 7
    Dernier message: 24/03/2009, 21h12
  2. Réponses: 1
    Dernier message: 16/05/2008, 09h20
  3. struts et connexion base de donnee
    Par yayamo dans le forum Struts 1
    Réponses: 11
    Dernier message: 09/05/2007, 18h26
  4. taille maximale d'une base de donnée paradox
    Par Anonymous dans le forum Paradox
    Réponses: 5
    Dernier message: 14/02/2004, 17h39
  5. [VB6] [ODBC] Référencer une base de données avec vb
    Par af.balog dans le forum VB 6 et antérieur
    Réponses: 6
    Dernier message: 13/09/2002, 09h51

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo