Daniol Thomas has Published 242 Answers

How to retrieve particular columns of a table using JDBC program?

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

A ResultSet interface in JDBC represents the tabular data generated by SQL queries. It has a cursor which points to the current row. Initially this cursor is positioned before first row.You can move the cursor using the next() method and, you can retrieve the column values of a row using ... Read More

The addAll() method of Java AbstractSequentialList class

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

The addAll() method of the AbstractSequentialList class inserts all the elements in the specified collection into this list at the specified position. Set the specified position as the parameter.The syntax is as follows:boolean addAll(int index, Collection<? extends E> c)Here, index is where you want to insert the first element from ... Read More

ArrayBlockingQueue toArray() Method in Java

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

The toArray() method of the ArrayBlockingQueue class returns an array containing all of the elements in this queue.The syntax is as follows:Object[] toArray()To work with ArrayBlockingQueue class, you need to import the following package:import java.util.concurrent.ArrayBlockingQueue;The following is an example to implement toArray() method of Java ArrayBlockingQueue class:Example Live Demoimport java.util.ArrayList; import ... Read More

Create Ennead Tuple using with() method in Java

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

To create Ennead Tuple, you can use the with() method. With that, you can also add elements to it. Let us first see what we need to work with JavaTuples. To work with Ennead class in JavaTuples, you need to import the following package:import org.javatuples.Ennead;Note: Download JavaTuples Jar library to ... Read More

LongStream findAny() method in Java

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

The findAny() method of the LongStream class in Java returns an OptionalLong describing some element of the stream, or an empty OptionalLong if the stream is empty.The syntax is as follows:OptionalLong findAny()Here, OptionalLong is a container object which may or may not contain a long value.To use the LongStream class ... Read More

What is DatabaseMetaData in JDBC? What is its significance?

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

Generally, Data about data is known as metadata. The DatabaseMetaData interface provides methods to get information about the database you have connected with like, database name, database driver version, maximum column length etc...Following are some methods of DatabaseMetaData class.MethodDescriptiongetDriverName()Retrieves the name of the current JDBC drivergetDriverVersion()Retrieves the version of the ... Read More

C++ Program to Perform Partition of an Integer in All Possible Ways

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

Here is a C++ Program to get all the unique partitions of a given integer such that addition of a partition results an integer. In this program, a positive integer n is given, and generate all possible unique ways to represent n as sum of positive integers.AlgorithmBegin    function displayAllUniqueParts(int ... Read More

C++ Program to Implement the Bin Packing Algorithm

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

The bin packing problem is a special type of cutting stock problem. In the bin packing problem, objects of different volumes must be packed into a finite number of containers or bins each of volume V in a way that minimizes the number of bins used. In computational complexity theory, ... Read More

What are the advantages of stored procedures?

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

Following are the advantages of stored procedures:Since stored procedures are compiled and stored, whenever you call a procedure the response is quick.you can group all the required SQL statements in a procedure and execute them at once.Since procedures are stored on the database server which is faster than client. You ... Read More

C++ Program to Compute DFT Coefficients Directly

Daniol Thomas

Daniol Thomas

Updated on 30-Jul-2019 22:30:25

In discrete Fourier transform (DFT), a finite list is converted of equally spaced samples of a function into the list of coefficients of a finite combination of complex sinusoids. They ordered by their frequencies, that has those same sample values, to convert the sampled function from its original domain (often ... Read More

Advertisements