Home »
Posts tagged "Learn Fundamentals of Java"
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 »
April 7, 2016 evirtualguru_ajaygourOnline Computer EducationNo Comment
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 https://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 »
March 1, 2016 evirtualguru_ajaygourOnline Computer EducationNo Comment
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 »
March 1, 2016 evirtualguru_ajaygourOnline Computer EducationNo Comment
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 »
March 1, 2016 evirtualguru_ajaygourOnline Computer EducationNo Comment
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 »
March 1, 2016 evirtualguru_ajaygourOnline Computer EducationNo Comment
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 »
February 29, 2016 evirtualguru_ajaygourOnline Computer EducationNo Comment
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 »
February 29, 2016 evirtualguru_ajaygourOnline Computer EducationNo Comment
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 »
February 29, 2016 evirtualguru_ajaygourOnline Computer EducationNo Comment
Page 1 of 41
2
3
4
Next »