mercredi 22 juin 2011

Le Solution de select et insert on JSP / mysql (Français version)

J'ai souffert avec ce gros problème, je google pour plusieurs jours, il n'existe aucune solution

blieve mei trouvé la solution inégalée.

et je tryied trouver une solution moi-même, et je l'ai finalement

alors voici la solution et je l'ai testé pour le mois, en plus j'ai créé un site web aveccette bibliothèque et de travailler t parfaite

la bibliothèque ont deux fonctions

enco (String arabe), et déco (String arabe)

la chaîne de retour stand

enco lorsque vous enregistrez une valeur dans la base, et pour les DECOD getingune valeur de base de données,

il fonctionne avec n'importe quel fournisseur de bases de données, MySQL, Oracle....

avis:

vous avez besoin de ce bref 2 lignes sur le premier de chaque page que vous utilisezsur elle l'qu'aucun Latine, dans notre cas de l'arabe

request.setCharacterEncoding <% ("UTF-8");
response.setCharacterEncoding ("UTF-8 ");%>

comment utiliser cette bibliothèque:

1: aller à la bibliothèque de fil dans le répertoire de l'application que vous et d'ajouternotre bibliothèque

2: ensuite, vous n'avez jsp / servlet Page importer la bibliothèque comme celle-ci
<% @ page import = "imad .*"%>

3: quand vous l'neead pour insérer une ligne arabes d'utiliser la bibliothèque comme celle-ci
String = art imadboy.enco (art2);
int t = Service.update ("INSERT INTO table ('" + art +"');

art2 c'est votre chaîne arabe
et c'est fait:), la chaîne arabe sauvegardé avec succès

4: quand u besoin de sélectionner la base de données utilisent cette
RseultSet rs = Service.select ("select de la table WHERE nom = 'arabic'");
if (rs.next ()) {
String = article imadboy.deco (rs.getString (2));
}


5: pas plus, c'est la façon dont il est le travail:) maintenant temps de télécharger la bibliothèque et un exempl

cliquez ici pour le télécharger:)

the Solution of select and insert on JSP / mysql (English virsion)

i suffered with this big problem , i google it  for many days , ther is no solution 

blieve mei found none solution  .

and i tryied find a solution  myself , and i did it finaly

so here is the solution and i have tested it for month ,plus i created a web site with this library and t work perfectly ,

the library have 2 functions 

enco(String arabic ) , and deco(String arabic)

the booth return  String

enco when you save a value into database , and decod for geting a value from database  , 

it's works with any database provider  , mysql , oracle ....

notice :

you need to writ this 2 lines on the first of every page you use on it the none latine in our case the arabic 

<%request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");%>

how to use this library:

1:go to library fil into you application directory and add our library

2: then on you jsp/servlet page  import the library like this
<%@page import="imad.*" %>

3: the when you neead to insert a arabic line use the library like this 
String art=imadboy.enco(art2);
int t=Service.update("insert into table values( '"+art+"');  

art2 it's your arabic string 
and it's done :) the arabic string saved succesfuly 

4 : when u need to select from database use this 
RseultSet rs=Service.select("select from table where name='arabic'");
if(rs.next()){
String article = imadboy.deco(rs.getString(2));
}


5 : no more , this is how it's work :) now time to download the library and an exempl


Download from official website mysql-connector-java-5.0.5-bin

Le driver MySQL Connecteur  tres important  pour connecter à MySQL base de donnée

 Télécharger