Below is an example that allows récuppérer a list of services a company (Service Computing, Communication, ...) to a database, and puts the list in a collection of type ArrayList.
This example has three classes:
  • Service Class: consists only of attributes Service :
public class Service {
String codeService;
String libelleService;
}
  • Class SelectServices : Allows you to connect to the database (connect method), and load the contents of the table service database in an ArrayList (Method ExtractionServices):
import java.sql.CallableStatement;
import java.sql.SQLException;
import java.sql.*;
import java.util.*;

public class SelectServices {
Connection conn;
public void connect() {
try
{
DriverManager.registerDriver(new com.mysql.jdbc.Driver ());
conn = DriverManager.getConnection
("jdbc:mysql://localhost:3306/test", "root", "root");
}
catch(SQLException sqle){
System.out.println(sqle.toString());
}
finally{
}
}
public List ExtractionServices() {
List listeServices = new ArrayList();
Service service;
try {
this.connect();
CallableStatement SelectSRV =
this.conn.prepareCall("SELECT CODE, LIBELLE FROM SERVICE");
ResultSet rs = SelectSRV.executeQuery();
while (rs.next()) {
// Allimentation ArrayList listeServices
service = new Service();
service.codeService = rs.getString("CODE");
service.libelleService = rs.getString("LIBELLE");
listeServices.add(service);
}
rs.close();
SelectSRV.close();
//return ListProjets;
this.conn.close();
} catch (SQLException sqle) {
System.out.println(sqle.toString());
} finally {
}
return listeServices;
}
}
  • Classe Appel : Class to test whether the collection is allimentée :
import java.util.*;
public class Appel {
public static void main(String args[]) {
SelectServices S = new SelectServices();
List LS = new ArrayList();
LS = S.ExtractionServices();
Iterator it = LS.iterator();
while (it.hasNext())
{
Service service = it.next();
System.out.println(service.libelleService);
}
LS = new LinkedList();
}
}

You are a beginner or advanced in Javascript, you know what jQuery (because you've read our introduction to jQuery) and you are finally convinced that using a Javascript framework, is it good? You are looking for an article that raises many bases without going into details of the jQuery API, like that, cold, and you do not know yet what it is?

You're in the right place!
A good environment for coding with jQuery

The worst to start coding in jQuery and more generally in Javascript is to start too quickly and to code a combo Notepad / Alert (): "Notepad", the name of the plain text editor for Windows and 'alert (), "named after the famous feature that we all used to debug the javascript.
A good editor is worth all the world's Notepad

For (good) start, you should obtain a text editor worthy of the name. An editor with syntax highlighting, could be free Notepad + + which I had already spoken.

Otherwise it yal'artillerie heavy, useless at the moment, the kind of JSEclipse has syntax highlighting and autocompletion. I say unnecessary because the time for jQuery, there is not, to my knowledge, a tool for self-completion.

By cons, for now, forget the debugging from within the editor, since the only tool that will be your friend here is the Firebug extension for Firefox.
A well used Firebug supersedes any alert () the world

Firebug is a Firefox extension that made me forget Web Developer.

The basis of the debugging is to trace the value of your variables. Where previously we would have used a rapid alert (), make a habit of using Firebug to check the value of your variables. I'll do an article soon on how to use Firebug.

jQuery Javascript vs. vs. PrototypeJS

The first surprise awaiting the developer used to encode the javascript is as follows: "But where are my duties if known?".

Indeed, to select a DOM element, it was customary to use the document.getElementById (that one who said document.element go hang himself at once;)).

With jQuery, I've learned to use the magical "$" which returns another element jQuery. But sometimes, it's like that, imagine you need to access a DOM element directly ... even if it would be for the wrong reasons since, with jQuery you can do the same thing with JavaScript - non-jQuery.

To simplify my thought, here is a small table of equivalences of my own:

Description Javascript PrototypeJS jQuery
Retourner la valeur contenue dans ma textbox monInputText monInputText.value() monInputText.value() monInputText.val()
Retourner la liste des options ma liste monSelect monSelect.options monSelect.options monSelect.attr(’options’)
Créer un nouveau div à la racine du document document.createElement(’div’) document.createElement(’div’) append(’div’)
Retourner l’élément DOM monDiv document.getElementById(’monDiv’) $(’monDiv’) $(’monDiv’)[0]
Parcourir un tableau d’options et les remplacer par « bla » var options = monSelect.options;
for (; i < options.length; i++) {
var option = options[i];
option = « bla »;

}
var options = $A(monSelect.options);
options.each(function(option) {
option.value() = « bla »;
});
monSelect.attr(’options’).each(
function() {
$(this).val(’bla’);
}
});

A good example: the double-watchlist

I have 2 lists side by side and double-clicking on an element of one, I would like to transfer to another. And vice versa.

$ ( "# ListeOrigine). Dblclick (function () (On double-click action
$ ( "# ListeOrigine option: selected"). Each (function () (For each option selected
$ ( "# ListeDestination select"). Append ($ (this)); Move option to the second list
));
))

Several things to note:

Dblclick function () takes as parameter a function pointer that sets just after "function () (".

In javascript, we would have needed to make a nice loop "for (). With jQuery, we use the each () function and it passes it as argument, again, a function pointer. Within this function, we may refer to the current object with $ (this).

To be attractive, they can also complete the above code by automatic sorting of the second list when it adds an element.

var options = $ ( "# listeDestination select option). get (). sort (function (a, b) (Reorders the second list
var keya = $ (a). attr ( "value"). toUpperCase ();
var keyb = $ (b). attr ( "value"). toUpperCase ();
if (keya keyB) return 1;
return 0;
));

Conclusion

I hope this little insight with the power of jQuery and the differences between "use this framework" and "use a different framework altogether or do not use a framework"!
Anyway, your questions and comments are welcome!



Starting a program
1) Import the required packages
2) Write the body of the program (variable declaration, creation methods, creation of the UI ...)
3) Write the main () method:

· Public static void main (String x []) (
· ... / / Your code
·)

Note: x is the array of arguments so it is most often replaced by
"Arguments" or "args". You can choose any name.
Note: all programs (not applets ...) must have a main () method, because this is
which defines them as a program!


Start Applet
1) Import the required packages
2) Report the main class:

· Public class x extends java.applet.Applet (
· ... / / Your code
·)

Note : x représente le nom de votre programme ainsi que le nom de son fichier source (x.java et
x.class).
Note: for programming applets in Java 2, is replaced by java.applet.Applet JApplet.
It is advisable to schedule your applets in Java 1.1 or better, 1.02 for java
the latest versions of major browsers (IE5, Communicator 4.7) do not support
java 2. Java 2 is supported by the browser HotJava Browser SUN
(http://www.sun.java.fr) and by the appletviewer (!), a tool that lets you test your
applet (included in the JDK).


Insert comments
Comments are lines in the program that are not taken into account by the
compiler. They serve only to increase the readability of source code. They are most often green in
development environments like Kawa, JBuilder, or VisualCafé.
Here's how you create a comment:

· This code is taken into account by the compiler / / This code is no longer taken into account by the
compiler

· / * Two slash do than post comments on 1 single line, while
this method with a beautiful star and a slash can still write on several lines
novels and tales of hundreds of pages starting with Once Upon a Time and ending
the eternal they were married and had many children .......................... * /

Summarize: / / 1 on one line
/ * ... */ sur plusieurs lignes


Write The full text of this paragraph means nothing because in programming, "it does not write text," one poster
on an output device (default screen of the computer!) text and can also display text in
one component of a UI (eg, the title of 'File' menu of your browser). In our the exemption, it
display of text in the output: here, the window command line (MS-DOS for PC
Windows) which was launched application. (see section JDK / execution of a program)
To display text in command line, using the method:
· System.out.println ( "Text to display");
· System.out.print ( "both methods are equivalent");
It is more difficult (it's on ...) to display text in an applet, because you must display it in a component
(an applet is launched in a frame inserted in the browser) graphical applet, both methods
above does not work. We use the method paint () the applet to set the display and method
drawString () to write the text:
· Public void paint (Graphics screen) (
· Screen.drawString ( "Hello", 5, 40);
·)

Note: 5 and 40 are the coordinates of a landmark text that originated from top-left corner
screen.




Application: The program Hello World!
Hello World! is famous: it is traditionally the first program that we do make a
person who starts in a programming language. Its purpose is to display the text Hello World! Must
So to run a program created with the main () method, and use the method System.out.println ()
to view our text. At work!


· Class HelloWorld (/ / Program start
· Public static void main (String args []) (/ / the beginning my main () method
· System.out.println ( "Hello World!") / / Display the desired text
·) / / End of my main () method
·) / / End of program

Note: to compile the program, you must name your file Helloworld.java, respecting the
sensitive.






Online Java Tutorial. It is the need of the hour as the world slowly get stable economy and the programming options and learnings are again started.

Java is a very powerful language to be used in designing web applications. Java is a product of sun microsystems and helps in desining standalone applications web, applications, custom applications, embedded system programming, mobile programming and so on.

If any one who want to make his career in computer software he has to be introduced to java. Such popular and powerful language it is. As per the different surveys and the feedbacks from the job consultancies we learn that the job opeinings for java lies between 40 to 60 percentage of total software openings are demanding programming skills in java.

Java lays the foundation for not only the programmers but also the testers when the write their scripting for automated testing. Learning java will help to achieve ones targets easily because of the inbuilt libraries it has, the security it provides, especially the platform independance.

There are several websites which provides tutorials for learning core java, advanced java, servlets, JSPs, architecture using frameworks like struts, hibernate, spring and so on. These sites will provide discussion forums where we can post our queries and the experts will post the answers to it. When registered with the site we will get regular mails on java updates, new

It is high-level object-oriented programming language developed by Sun Microsystems in 1995. It is very similar to C++. It was used for the project set top box, was created by James Gosling in 1991. It is the modified from the language Oak. Oak was unsuccessful in the market. So Sun modified this language and changed its name to Java. It is very one of the popular programming language because of platform independent nature and used in both computer and electronic devices. Platform independent means write once and run anywhere, only Java Virtual Machine needed to run Java program on any platform.

Virtosoftware releases Russian and Chinese localization for its web part for Microsoft SharePoint – Virto Ajax Calendar. With Russian and Chinese in addition to English, German, Spanish and French Virto Calendar supports now six languages.

Virto Calendar is built on Ajax technology, designed for Windows SharePoint Services 3.0 and Microsoft .NET Framework 3.5, and aimed to provide SharePoint users with new features that are not available in the standard SharePoint calendar. Virto Ajax Calendar substantially expands the functionality of the default Microsoft SharePoint calendar by a wide range of features and capabilities.

First, it enables users to view all their events, even from different SharePoint lists, in a single calendar. Moreover, with Virto Ajax Calendar not only SharePoint lists but also SQL tables can be used as a data source for calendar events. Second, it provides extremely simple and user friendly interface allowing for creating new calendar events with a single click, and using drug & drop to change event timeframe. Further, Virto Ajax Calendar allows for full customization of the information displayed in the event tooltips. Finally, it supports MOSS Audience Targeting that allows restricting the access to list events only to specified users and user groups.

Virto Ajax Calendar with the support of six languages can be found on the Virtosoftware web site. In the nearest future Virtosoftware will release Russian and Chinese localization for its other web parts: Alert Customizer, Workflow Activity Kit, Clock & Weather and Password Changer.

Virtosoftware Company uses the most advanced technologies trying to predict today what our clients may need tomorrow. Visit our website http://www.virtosoftware.com for more information about Virto Ajax Calendar and other Microsoft SharePoint web parts by Virtosoftware, download evaluation versions to test the quality of our products, and learn how they can help your business.

Although, the current business market is being highly affected by recession, there are certain types of professionals who have been successful in maintaining their proficiency as well their jobs. One such category of professionals is the java coders. Such professionals in collaboration with the web designers have been able to achieve an immense amount of success in the Website development

across USA.

If you are aware about the basic principles of coding in Java, then you can definitely expect a good job. The java coders working for different software firms have worked in collaboration with each other to achieve success in almost all the java-based projects. Website Development in USA has been assisted by the highly skilled professionals who are well aware about all the basic programming tools that can help in the timely completion of the projects related to different technologies.

The job opportunities for the java coders would never come to an end because most of the projects undertaken in the present times are based on Java and other Java tools. Since everybody is finding internet to be the best means of promoting their business, hence if you are good at Java coding, you can always try hands on working as a freelance coder. You can easily earn huge sums of money by working as a freelance coder and at the same time you can get a great opportunity of working with the extremely renowned software firms.

The credit for the success of the Website Development USA goes to all those programmers, coder and developers who put in all their efforts to make it a point that the websites they design for the different business firms are well able to attract more and more customers towards the work undertaken by the business firms. Even though a large number of software technologies are being launched into the software market on a daily basis, the importance of java would never fade. You would easily find projects using the concepts of Java and the other languages related with Java.

Java is considered to be a step ahead of the programming language C++. Hence, it is believed that Java is here to stay for many long years and the software professionals dealing with the concepts of Java can definitely expect more stable jobs and great opportunities in the near future. Since the Java programming is a bit complex, so if you wish to pursue a career in the field of Java, you need to be sure that the basic concepts of Java are clear to you. You can easily gather a lot of useful information about Java from the different websites which offer every single bit of information about the programming language Java.

Java coders would always remain in demand but without them undertaking projects related to Java would be nearly impossible. Website Development USA has also seen a huge success only because of the efforts of the efficient web designers who with the help of their brilliant designing skills create websites which serve to the needs of the business owners and are also extremely user-friendly.