<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gronono.fr &#187; java</title>
	<atom:link href="http://www.gronono.fr/wordpress/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gronono.fr/wordpress</link>
	<description>Un site fait par moi pour tout le monde.</description>
	<lastBuildDate>Mon, 16 May 2011 22:41:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Bash et l&#8217;auto-complétion ant</title>
		<link>http://www.gronono.fr/wordpress/2010/11/bash-et-lauto-completion-ant/</link>
		<comments>http://www.gronono.fr/wordpress/2010/11/bash-et-lauto-completion-ant/#comments</comments>
		<pubDate>Fri, 05 Nov 2010 13:56:57 +0000</pubDate>
		<dc:creator>Arnaud Brunet</dc:creator>
				<category><![CDATA[Informatique]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.gronono.fr/wordpress/?p=362</guid>
		<description><![CDATA[Si vous utilisez le shell bash, sachez que ant fourni un script permettant de faire de l'auto-complétion sur la ligne de commande. Pour cela, il suffit de lancer la commande : complete -C $ANT_HOME/bin/complete-ant-cmd.pl ant build.sh Remplacer $ANT_HOME par le dossier d'installation de ant. /usr/share/ant/ sous Debian. Maintenant lorsque vous tapez la commande ant suivit [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gronono.fr/wordpress/wp-content/uploads/2010/11/ant.jpeg"><img class="alignleft size-full wp-image-214" title="Logo Ant" src="http://www.gronono.fr/wordpress/wp-content/uploads/2010/11/ant.jpeg" alt="" width="64" height="64" /></a></p>
<p>Si vous utilisez le shell bash, sachez que ant fourni un script permettant de faire de l'auto-complétion sur la ligne de commande. Pour cela, il suffit de lancer la commande :<br />
<code>complete -C $ANT_HOME/bin/complete-ant-cmd.pl ant build.sh</code><br />
<span style="font-size: smaller;">Remplacer $ANT_HOME par le dossier d'installation de ant. /usr/share/ant/ sous Debian.</span></p>
<p>Maintenant lorsque vous tapez la commande ant suivit de TAB, la liste des cibles publiques (target avec description) s'affiche.<br />
Marche aussi pour l'option -f, seuls les fichiers .xml sont affichés.</p>
<p>Pour l'activer de façon permanente, il suffit de l'ajouter au fichier .bashrc.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gronono.fr/wordpress/2010/11/bash-et-lauto-completion-ant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hibernate : Compter les résultats d&#8217;un criteria</title>
		<link>http://www.gronono.fr/wordpress/2008/06/hibernate-compter-les-resultats-dun-criteria/</link>
		<comments>http://www.gronono.fr/wordpress/2008/06/hibernate-compter-les-resultats-dun-criteria/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 07:54:41 +0000</pubDate>
		<dc:creator>Arnaud Brunet</dc:creator>
				<category><![CDATA[Informatique]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[criteria]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.gronono.fr/?p=45</guid>
		<description><![CDATA[Voici une petite astuce pour compter le nombre de résultats d'une requète Hibernate via l'API Critiria : Criteria criteria = createCriteria&#40;...&#41;; criteria.setProjection&#40;Projections.rowCount&#40;&#41;&#41;; int nbResults = &#40;&#40;Integer&#41; criteria.uniqueResult&#40;&#41;&#41;.intValue&#40;&#41;; C'est aussi simple que ça. Il suffit de créer son Critiria puis de faire une projection sur le nombre de résultat.]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-237 alignleft" title="Logo Hibernate" src="http://www.gronono.fr/wordpress/wp-content/uploads/2008/06/images.jpeg" alt="Logo Hibernate" width="45" height="45" />Voici une petite astuce pour compter le nombre de résultats d'une requète Hibernate via l'API Critiria :<br />
<span id="more-45"></span></p>
<pre class="java">Criteria criteria = createCriteria<span style="color: #66cc66;">&#40;</span>...<span style="color: #66cc66;">&#41;</span>;
criteria.<span style="color: #006600;">setProjection</span><span style="color: #66cc66;">&#40;</span>Projections.<span style="color: #006600;">rowCount</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #993333;">int</span> nbResults = <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AInteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Integer</span></a><span style="color: #66cc66;">&#41;</span> criteria.<span style="color: #006600;">uniqueResult</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">intValue</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre>
<p>C'est aussi simple que ça. Il suffit de créer son Critiria puis de faire une projection sur le nombre de résultat.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gronono.fr/wordpress/2008/06/hibernate-compter-les-resultats-dun-criteria/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paramètres dans les requètes Hibernate</title>
		<link>http://www.gronono.fr/wordpress/2008/03/parametres-dans-les-requetes-hibernate/</link>
		<comments>http://www.gronono.fr/wordpress/2008/03/parametres-dans-les-requetes-hibernate/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 04:30:00 +0000</pubDate>
		<dc:creator>Arnaud Brunet</dc:creator>
				<category><![CDATA[Informatique]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.gronono.fr/?p=19</guid>
		<description><![CDATA[Bonjour, Si vous utilisez Hibernate comme outil d'ORM, vous savez surement que vous pouvez afficher les requêtes SQL en initialisant dans la configuration de la SessionFactory la propriété hibernate.show_sql à true.Maintenant Hibernate affiche dans la console les requètes SQL qu'il exécute. Mais tous les paramètres des requêtes sont affichés avec des ?. Pour y remédier, [...]]]></description>
			<content:encoded><![CDATA[<p>Bonjour,</p>
<p>Si vous utilisez Hibernate comme outil d'ORM, vous savez surement que vous pouvez afficher les requêtes SQL en initialisant dans la configuration de la SessionFactory la propriété <code>hibernate.show_sql</code> à <code>true</code>.<br />Maintenant Hibernate affiche dans la console les requètes SQL qu'il exécute. Mais tous les paramètres des requêtes sont affichés avec des ?.</p>
<p>Pour y remédier, il faut définir le niveau du logger <code>log4j.logger.org.hibernate.type</code> à <code>trace</code> dans le fichier <code>log4j.properties</code>.</p>
<p>Hibernate vous affichera toujours la requête avec ? mais juste en dessous, vous aurez le détail du binding qu'il fait.</p>
<p>A bientôt,<br />Arnaud</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gronono.fr/wordpress/2008/03/parametres-dans-les-requetes-hibernate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conteneur de Servlets/JSP gratuit</title>
		<link>http://www.gronono.fr/wordpress/2008/01/conteneur-de-servletsjsp-gratuit/</link>
		<comments>http://www.gronono.fr/wordpress/2008/01/conteneur-de-servletsjsp-gratuit/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 08:54:00 +0000</pubDate>
		<dc:creator>Arnaud Brunet</dc:creator>
				<category><![CDATA[Informatique]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jsp]]></category>
		<category><![CDATA[myjavaserver]]></category>
		<category><![CDATA[servlet]]></category>

		<guid isPermaLink="false">http://www.gronono.fr/?p=14</guid>
		<description><![CDATA[Hier, je parlais de MyJavaServer un conteneur de Servlets/JSP gratuit. J'ai eu un peu de mal à me faire à leur système de déploiement non standard. Mais une fois habitué, je pense qu'il peut m'être utile pour mon projet de site perso. Il faut savoir que les servlets et autres classes sont placés habituellement dans [...]]]></description>
			<content:encoded><![CDATA[<p>Hier, je parlais de <a href="http://www.myjavaserver.com/" class="broken_link">MyJavaServer</a> un conteneur de Servlets/JSP gratuit.</p>
<p>J'ai eu un peu de mal à me faire à leur système de déploiement non standard. Mais une fois habitué, je pense qu'il peut m'être utile pour mon projet de site perso.</p>
<p>Il faut savoir que les servlets et autres classes sont placés habituellement dans le dossier WEB-INF/classes. Or sur MyJavaServer, tous les utilisateurs partagent ce même dossier et ont chacun un sous-dossier personnel qui en fait un lien symbolique vers la racine de leur webapp.<br />
Donc pour déployer une servlet celle-ci doit être un package du nom de l'utilisateur (ou un sous-package) et être placé directement à la racine.</p>
<p>Par exemple mon login est gronono. Il faut donc que mes servlets soient dans le package gronono et les fichiers .class placés directement à la racine de mon compte.</p>
<p>Voici la servlet qui m'a servie de test :</p>
<pre class="java"><span style="color: #000000; font-weight: bold;">package</span> gronono;
&nbsp;
<span style="color: #a1a100;">import java.io.IOException;</span>
<span style="color: #a1a100;">import java.io.PrintWriter;</span>
<span style="color: #a1a100;">import javax.servlet.ServletException;</span>
<span style="color: #a1a100;">import javax.servlet.http.HttpServlet;</span>
<span style="color: #a1a100;">import javax.servlet.http.HttpServletRequest;</span>
<span style="color: #a1a100;">import javax.servlet.http.HttpServletResponse;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> HelloServlet <span style="color: #000000; font-weight: bold;">extends</span> HttpServlet <span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #993333;">void</span> doGet<span style="color: #66cc66;">&#40;</span>HttpServletRequest request, HttpServletResponse response<span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ServletException, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AIOException+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">IOException</span></a> <span style="color: #66cc66;">&#123;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3APrintWriter+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">PrintWriter</span></a> writer = response.<span style="color: #006600;">getWriter</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    writer.<span style="color: #006600;">write</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Hello&quot;</span><span style="color: #66cc66;">&#41;</span>;
    response.<span style="color: #006600;">flushBuffer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<p>Une fois compilé, le fichier HelloServlet.class est à placer dans à la racine de mon compte.<br />
La servlet est directement accessible via l'url : http://www.myjavaserver.com/servlet/gronono.HelloServlet</p>
<p>A bientôt.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gronono.fr/wordpress/2008/01/conteneur-de-servletsjsp-gratuit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Base de données gratuite</title>
		<link>http://www.gronono.fr/wordpress/2008/01/base-de-donnees-gratuite/</link>
		<comments>http://www.gronono.fr/wordpress/2008/01/base-de-donnees-gratuite/#comments</comments>
		<pubDate>Sat, 19 Jan 2008 09:50:00 +0000</pubDate>
		<dc:creator>Arnaud Brunet</dc:creator>
				<category><![CDATA[Informatique]]></category>
		<category><![CDATA[base de données]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.gronono.fr/?p=13</guid>
		<description><![CDATA[Bonjour, J'ai le projet de réaliser un site perso entièrement à la main. Ne pouvant pas laisser mon ordinateur tout le temps allumé et disposant d'une connexion internet relativement bas débit, il m'est impossible de l'héberger chez moi. Je suis donc à la recherche des services suivants : base de données, serveur de Servlets/JSP, espace [...]]]></description>
			<content:encoded><![CDATA[<p>Bonjour,</p>
<p>J'ai le projet de réaliser un site perso entièrement à la main. Ne pouvant pas laisser mon ordinateur tout le temps allumé et disposant d'une connexion internet relativement bas débit, il m'est impossible de l'héberger chez moi.</p>
<p>Je suis donc à la recherche des services suivants : base de données, serveur de Servlets/JSP, espace disque.<br />
En recherchant un peu, on peut trouver ces services gratuitement sur le web.</p>
<p>Pour la base de données, je viens de m'inscrire sur <a href="http://www.freemysql.net">FreeMySQL.net</a> qui propose une base de données MySQL gratuitement.<br />
Le serveur est hebergé sur SQL06.FREEMYSQL.NET sur le port 3306. Et la base est disponible dès que vous l'avais créée.</p>
<p>Voici un petit programme écrit en Java pour la tester :</p>
<pre class="java"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Test <span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #993333;">void</span> main<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> args<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> driver = <span style="color: #ff0000;">&quot;com.mysql.jdbc.Driver&quot;</span>;
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> dbHost = <span style="color: #ff0000;">&quot;SQL06.FREEMYSQL.NET&quot;</span>;
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> dbPort = <span style="color: #ff0000;">&quot;3306&quot;</span>;
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> database = <span style="color: #ff0000;">&quot;gronono&quot;</span>;
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> url = <span style="color: #ff0000;">&quot;jdbc:mysql://&quot;</span> + dbHost + <span style="color: #ff0000;">&quot;:&quot;</span> + dbPort + <span style="color: #ff0000;">&quot;/&quot;</span> + database;
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> user = <span style="color: #ff0000;">&quot;gronono&quot;</span>;
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> password = <span style="color: #ff0000;">&quot;*******&quot;</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">Class</span>.<span style="color: #006600;">forName</span><span style="color: #66cc66;">&#40;</span>driver<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AClassNotFoundException+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">ClassNotFoundException</span></a> e<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">err</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Erreur lors du chargement du driver : &quot;</span><span style="color: #66cc66;">&#41;</span>;
      e.<span style="color: #006600;">printStackTrace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
      <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">exit</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">-1</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AConnection+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Connection</span></a> cnx = <span style="color: #000000; font-weight: bold;">null</span>;
    <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>
      cnx = <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ADriverManager+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">DriverManager</span></a>.<span style="color: #006600;">getConnection</span><span style="color: #66cc66;">&#40;</span>url, user, password<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASQLException+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">SQLException</span></a> e<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">err</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Impossible de se connecter à la base &quot;</span> + url + <span style="color: #ff0000;">&quot; avec l'utilisateur &quot;</span> + user<span style="color: #66cc66;">&#41;</span>;
      e.<span style="color: #006600;">printStackTrace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
      <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">exit</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">-1</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AStatement+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Statement</span></a> stmt = <span style="color: #000000; font-weight: bold;">null</span>;
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AResultSet+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">ResultSet</span></a> rs = <span style="color: #000000; font-weight: bold;">null</span>;
    <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>
      stmt = cnx.<span style="color: #006600;">createStatement</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
      rs =   stmt.<span style="color: #006600;">executeQuery</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;select 1 from dual&quot;</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">next</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span>rs.<span style="color: #006600;">getString</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASQLException+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">SQLException</span></a> e<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
      <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">err</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Impossible de se connecter à la base &quot;</span> + url + <span style="color: #ff0000;">&quot; avec l'utilisateur &quot;</span> + user<span style="color: #66cc66;">&#41;</span>;
      e.<span style="color: #006600;">printStackTrace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
      <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">exit</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">-1</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">finally</span> <span style="color: #66cc66;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>stmt != <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
          <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>rs != <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            rs.<span style="color: #006600;">close</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
          <span style="color: #66cc66;">&#125;</span>
          stmt.<span style="color: #006600;">close</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #66cc66;">&#125;</span>
      <span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASQLException+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">SQLException</span></a> e<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">err</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Impossible de fermer la connexion : &quot;</span><span style="color: #66cc66;">&#41;</span>;
        e.<span style="color: #006600;">printStackTrace</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">exit</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">-1</span><span style="color: #66cc66;">&#41;</span>;
      <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Fin&quot;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<p>Prochaine étape trouver un conteneur de Servlet/JSP. Je sais qu'il existe <span style="text-decoration: line-through;">MyJavaServer</span>. Il me reste encore à le tester.</p>
<p>A bientôt.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gronono.fr/wordpress/2008/01/base-de-donnees-gratuite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Eclipse RCP] Menu &#171;&#160;Nouveau&#160;&#187;</title>
		<link>http://www.gronono.fr/wordpress/2007/12/eclipse-rcp-menu-nouveau/</link>
		<comments>http://www.gronono.fr/wordpress/2007/12/eclipse-rcp-menu-nouveau/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 20:01:00 +0000</pubDate>
		<dc:creator>Arnaud Brunet</dc:creator>
				<category><![CDATA[Informatique]]></category>
		<category><![CDATA[eclipse rcp]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.gronono.fr/?p=7</guid>
		<description><![CDATA[Bonjour, Je met ici quelques lignes sur comment faire un menu "Nouveau" comme dans l'IDE pour les applications Eclipse RCP. Dans la classe ApplicationActionBarAdvisor, on commence par définir le menu : &#160; MenuManager fileMenu = new MenuManager&#40;&#34;&#38;Fichier&#34;, IWorkbenchActionConstants.M_FILE&#41;; MenuManager newMenu = new MenuManager&#40;&#34;&#38;Nouveau&#34;, ActionFactory.NEW.getId&#40;&#41;&#41;; newMenu.add&#40;new Separator&#40;IWorkbenchActionConstants.MB_ADDITIONS&#41;&#41;; newMenu.add&#40;new BaseNewWizardMenu&#40;window, ActionFactory.NEW.getId&#40;&#41;&#41;&#41;; fileMenu.add&#40;newMenu&#41;; &#160; Si on veut afficher [...]]]></description>
			<content:encoded><![CDATA[<p>Bonjour,</p>
<p>Je met ici quelques lignes sur comment faire un menu "Nouveau" comme dans l'IDE pour les applications Eclipse RCP.</p>
<p>Dans la classe ApplicationActionBarAdvisor, on commence par définir le menu :</p>
<pre class="java">&nbsp;
MenuManager fileMenu = <span style="color: #000000; font-weight: bold;">new</span> MenuManager<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;&amp;Fichier&quot;</span>, IWorkbenchActionConstants.<span style="color: #006600;">M_FILE</span><span style="color: #66cc66;">&#41;</span>;
MenuManager newMenu = <span style="color: #000000; font-weight: bold;">new</span> MenuManager<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;&amp;Nouveau&quot;</span>, ActionFactory.<span style="color: #000000; font-weight: bold;">NEW</span>.<span style="color: #006600;">getId</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
newMenu.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> Separator<span style="color: #66cc66;">&#40;</span>IWorkbenchActionConstants.<span style="color: #006600;">MB_ADDITIONS</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
newMenu.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> BaseNewWizardMenu<span style="color: #66cc66;">&#40;</span>window, ActionFactory.<span style="color: #000000; font-weight: bold;">NEW</span>.<span style="color: #006600;">getId</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
fileMenu.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>newMenu<span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>Si on veut afficher un assistant, il faut le fichier plugin.xml rajouter les lignes :</p>
<pre class="xml">&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;extension</span> <span style="color: #000066;">point</span>=<span style="color: #ff0000;">&quot;org.eclipse.ui.perspectiveExtensions&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;perspectiveExtension</span> <span style="color: #000066;">targetID</span>=<span style="color: #ff0000;">&quot;identifiantDeLaPerspetive&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;newWizardShortcut</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;identifiantDuWizard&quot;</span> <span style="font-weight: bold; color: black;">/&gt;</span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/perspectiveextension<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/extension<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;</pre>
<p>Le wizard doit implémenter l'interface INewWizard et être déclaré dans le fichier plugin.xml.<br />
L'identifiant de la perspective permet de spécifier sous quelle perspective sera affiché l'assistant. Pour l'afficher sous toutes les perspectives, il faut mettre une étoile ('*').</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gronono.fr/wordpress/2007/12/eclipse-rcp-menu-nouveau/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

