Home » Posts tagged "Learn Fundamentals of Java"

Learn about “The Java security model”.

The Java security model The Java security model, introduced in Java 2, is the basis of highly secured and distributed enterprise Java applications. The model is based on a customizable “sandbox” in which Java software programs can run safely, without potential risk to systems or users. Java security technology includes a large set of APIs, tools, and implementations of commonly used security algorithms, mechanisms, and protocols. The architecture of the Java...
Continue reading »

Learn “How to Installing and Staring NetBeans IDE” Java Programming.

How to Installing and Staring NetBeans IDE To install NetBeans IDE, first you have to download it and then follow the instructions given below to install it. Step 1: Visit http://netbeans.org/downloads/ in your browser. Step 2: Click to select the appropriate NetBeans bundle to download (Figure 1). Step 3: Once you click on the Download button the screen as per Figure 2 will appear and the download will start automatically. Step...
Continue reading »

Learn Fundamentals of Java Programming “Database connection from Java in Java Programming ” Lesson 29

Database connection from Java We are now ready to write a Java program to connect to a database and execute a SQL query on the database. In our MySQL database, we have already created a database called bookstore and a table called book within it. The columns of this table are (title, author, publisher, genre, and price). We have also inserted 5 rows into the table (Figure 1.11j). We will now...
Continue reading »

Learn Fundamentals of Java Programming “Adding the mysql connector JAR to the NetBeans Libraries in Java Programming ” Lesson 28

Adding the mysql connector JAR to the NetBeans Libraries Before writing the Java program to connect to the database, we have to also add the mysql connector JAR file to the Libraries in our project. The following steps show you how to do just that: Step1: Under the Projects tab, right click on the Libraries node and select ADD JAR/ Folder… (Figure 1.11g). Step 7: In the Add JAR/Folder dialog box...
Continue reading »

Learn Fundamentals of Java Programming “Database Connectivity in Java Programming ” Lesson 27

Database Connectivity In this section, we will learn to connect a MySQL database to a Java program and get back the results from executing a SQL query on the database. Connecting a database to a Java program is easy with NetBeans since it allows us to connect directly to a MySQL server. Connecting to the MySQL Server in NetBeans We first need to configure NetBeans to Register and connect a MySQL...
Continue reading »

Learn Fundamentals of Java Programming “Exception Handling in Java Programming ” Lesson 26

Exception Handling By now you may have written quite a few programs. Some of your programs when executed may have terminated unexpectedly with runtime errors. The errors could have occurred because an array index reference was out of range, an attempt was made to divide an integer by zero, there was insufficient computer memory and so on. Such an error situation that is unexpected in the program execution and causes it...
Continue reading »

Learn Fundamentals of Java Programming “String Manipulation in Java Programming ” Lesson 25

String Manipulation In the previous section, we learned to manipulate arrays using Java prebuilt classes. In this section we learn to manipulate Strings using the String class present in the java.lang package. The first method we will use from the String class is the toUpperCase() method. This method converts a string to all uppercase letters. String myString = “Hello World”; System.out.println(“UpperCase: ” + myString.toUpperCase()); The output of the code given above will...
Continue reading »

Learn Fundamentals of Java Programming “Array Manipulation in Java Programming ” Lesson 24

Array Manipulation In the previous section you learned about some useful prebuilt classes for data input. In this section, we will explore the prebuilt Arrays class from the java.util package for array handling. The Array class has a number of useful methods. Let’s start by using the sort() method to sort an array of integers in ascending order. First we import java.util.Arrays class. Then in the main() method, we just call...
Continue reading »