Database Operations in Java

karthikeya Boyini
Updated on 19-Jun-2020 13:27:08

2K+ Views

This article provides an example of how to create a simple JDBC application. This will show you how to open a database connection, execute a SQL query, and display the results.Creating JDBC ApplicationThere are following six steps involved in building a JDBC application −Import the packages: Requires that you include the packages containing the JDBC classes needed for database programming. Most often, using import java.sql.* will suffice.Register the JDBC driver: Requires that you initialize a driver so you can open a communication channel with the database.Open a connection: Requires using the DriverManager.getConnection() method to create a Connection object, which represents ... Read More

Maintain Data Integrity in Child Table When Parent Record is Deleted

Lakshmi Srinivas
Updated on 19-Jun-2020 13:26:49

342 Views

When two tables are connected with Foreign key and data in the parent table is deleted, for which record exists in child table too, then followings are the ways to maintain data integrity −On Delete CascadeThis option will remove the record from child table too if that value of the foreign key is deleted from the main table.On Delete Null This option will set all the values in that record of child table as NULL, for which the value of the foreign key is deleted from the main table.

Coupling in Java

karthikeya Boyini
Updated on 19-Jun-2020 13:22:22

5K+ Views

Coupling refers to the usage of an object by another object. It can also be termed as collaboration. This dependency of one object on another object to get some task done can be classified into the following two types −Tight coupling - When an object creates the object to be used, then it is a tight coupling situation. As the main object creates the object itself, this object can not be changed from outside world easily marked it as tightly coupled objects.Loose coupling - When an object gets the object to be used from the outside, then it is a loose coupling ... Read More

Create Two-Dimensional Array in JavaScript

Nikitha N
Updated on 19-Jun-2020 13:21:23

748 Views

A two-dimensional array has more than one dimension, such as myarray[0][0] for element one, myarray[0][1] for element two, etc. To create a two-dimensional array in JavaScript, you can try to run the following code −ExampleLive Demo                                        var myarray=new Array(3);                  for (i=0; i

Create an Array of Strings in JavaScript

V Jyothi
Updated on 19-Jun-2020 13:19:50

11K+ Views

To create an array of strings in JavaScript, simply assign values −var animals = ["Time", "Money", "Work"];You can also use the new keyword to create an array of strings in JavaScript −var animals = new Array("Time", "Money", "Work");The Array parameter is a list of strings or integers. When you specify a single numeric parameter with the Array constructor, you specify the initial length of the array. The maximum length allowed for an array is 4, 294, 967, 295.ExampleLet’s see an example to create arrays in JavaScript −Live Demo                     JavaScript Arrays ... Read More

Properties of an Array Object in JavaScript

Syed Javed
Updated on 19-Jun-2020 13:18:59

5K+ Views

The Array object lets you store multiple values in a single variable. It stores a fixed-size sequential collection of elements of the same type.The following is the list of the properties of the Array object −Sr.NoProperty & Description1constructorReturns a reference to the array function that created the object.2indexThe property represents the zero-based index of the match in the string.3inputThis property is only present in arrays created by regular expression matches.4lengthReflects the number of elements in an array.5prototypeThe prototype property allows you to add properties and methods to an object.ExampleLet’s see an example of the prototype propertyLive Demo       ... Read More

Count Paragraphs in Text File Using Java

karthikeya Boyini
Updated on 19-Jun-2020 13:13:30

662 Views

We can read paragraphs in a file by reading it in a string and then spilting based on "\r" pattern. See the example below −ExampleConsider the following text file in the classpath.test.txtThis is Line 1 This is Line 2 This is Line 3 This is Line 4 This is Line 5 This is Line 6 This is Line 7 This is Line 8 This is Line 9 This is Line 10Tester.javaimport java.io.File; import java.io.FileInputStream; import java.io.IOException; public class Tester {    public static void main(String args[]) throws IOException {       FileUtil fileUtil = ... Read More

Count Characters in Text File Using Java

karthikeya Boyini
Updated on 19-Jun-2020 13:10:12

6K+ Views

We can read characters in a file using BufferedReader class of Java. See the example below −ExampleConsider the following text file in the classpath.test.txtThis is Line 1 This is Line 2 This is Line 3 This is Line 4 This is Line 5 This is Line 6 This is Line 7 This is Line 8 This is Line 9 This is Line 10Tester.javaimport java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; public class Tester {    private static final String FILE_PATH = "data.txt";    public static void main(String args[]) throws IOException {       ... Read More

Using Operators in Analytic Privilege in SAP HANA

John SAP
Updated on 19-Jun-2020 13:05:10

137 Views

You have the following Operators that can be used to define restrictions

Limitations of Database Management System

Kristi Castro
Updated on 19-Jun-2020 12:58:42

20K+ Views

Database Management System is quite useful compared to the file based management system. However, it does have some disadvantages. Some of those are as follows −More CostlyCreating and managing a database is quite costly. High cost software and hardware is required for the database. Also highly trained staff is required to handle the database and it also needs continuous maintenance. All of these ends up making a database quite a costly venture.High ComplexityA Database Management System is quite complex as it involves creating, modifying and editing a database. Consequently, the people who handle a database or work with it need ... Read More

Advertisements