What is Concur Updatable ResultSet in JDBC

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

3K+ Views

It is a constant of the ResultSet class representing the concurrency mode for a ResultSet object that may be updated. In general, you will pass this as a value to the createStatement() method.Statement createStatement(int resultSetType, int resultSetConcurrency);A ResultSet with this as concurrency is updatable. i.e. once you get a ResultSet object you can update its contents.ExampleSuppose, we have a table named Employee in the database with the following contents:+----+---------+--------+----------------+ | Id | Name    | Salary | Location       | +----+---------+--------+----------------+ | 1  | Amit    | 3000   | Hyderabad      | | 2  | Kalyan  | ... Read More

LocalDateTime isSupported Method in Java

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

135 Views

It can be checked if a ChronoUnit is supported by the LocalDateTime class or not by using the isSupported() method in the LocalDateTime class in Java. This method requires a single parameter i.e. the ChronoUnit to check. It returns true if the ChronoUnit is supported by the LocalDateTime class and false otherwise.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; import java.time.temporal.*; public class Demo {    public static void main(String[] args) {       LocalDateTime ldt = LocalDateTime.now();       System.out.println("The LocalDateTime is: " + ldt);       boolean flag = ldt.isSupported(ChronoUnit.HOURS);   ... Read More

Create Label-Value Tuple Using with Method in Java

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

126 Views

You can create a LabelValue tuple using with() method as well. The parameter of the with() method is the label and value of the LabelValue class.Let us first see what we need to work with JavaTuples. To work with LabelValue class in JavaTuples, you need to import the following packageimport org.javatuples.LabelValue;Note Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project -> Properties -> Java Build Path -> Add External Jars and upload the downloaded JavaTuples jar file. Refer the below guide for all the steps to run JavaTuplesSteps − How to ... Read More

AbstractCollection Class in Java

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

522 Views

The AbstractCollection class provides an implementation of the Collection interface. This is done to minimize the effort in the implementation of this interface.For an unmodifiable collectionExtend this class and provide implementations for the iterator and size methods.For modifiable collectionAdditionally override the add() method of the class. The iterator method returns the iterator and it must implement the remove() method.The syntax is as follows.public abstract class AbstractCollection extends Object implements CollectionHere, Object is the root of the class hierarchy and Collection is a group of objects.To work with AbstractCollection class in Java, import the following package.import java.util.AbstractCollection;Let us now see an ... Read More

Octal Literals in C

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

5K+ Views

In C/C++ we can use octal literals by typing a zero before the actual number. For example, if an octal number is 25, then we have to write 025.Example Code#include int main() {    int a = 025;    int b = 063;    printf("Decimal of 25(Octal) is %d", a);    printf("Decimal of 63(Octal) is %d", b); }OutputDecimal of 25(Octal) is 21 Decimal of 63(Octal) is 51

Use removeLast in Android ConcurrentLinkedDeque

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

119 Views

Before getting into the example, we should know what ConcurrentLinkedDeque is, it is unbounded deque based on linked nodes. Multiple threads can access deque elements with safety.This example demonstrates about How to use removeLast() in android ConcurrentLinkedDequeStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     In the above code, we have taken a text view to show ConcurrentLinkedDeque elements.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Build; import android.os.Bundle; ... Read More

Sort More Than One Column at a Time in MySQL

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

170 Views

To sort more than one column at a time, you can use ORDER BY clause. Following is the syntax −select yourColumnName1, yourColumnName2, yourColumnName3 from yourTableName order by yourColumnName2, yourColumnName3;Let us first create a table −mysql> create table doubleSortDemo    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> StudentName varchar(100),    -> StudentCountryName varchar(10)    -> ); Query OK, 0 rows affected (0.71 sec)Following is the query to insert records in the table using insert command −mysql> insert into doubleSortDemo(StudentName, StudentCountryName) values('John', 'AUS'); Query OK, 1 row affected (0.21 sec) mysql> insert into doubleSortDemo(StudentName, StudentCountryName) values('Sam', ... Read More

Format Java LocalDateTime as ISO Date Time Format

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

4K+ Views

At first, set the date:LocalDateTime dateTime = LocalDateTime.of(2019, Month.JULY, 9, 10, 20);Now, format the datetime as ISO_DATE_TIME format:String str = dateTime.format(DateTimeFormatter.ISO_DATE_TIME);Exampleimport java.time.LocalDateTime; import java.time.Month; import java.time.format.DateTimeFormatter; public class Demo {    public static void main(String[] args) {       LocalDateTime dateTime = LocalDateTime.of(2019, Month.JULY, 9, 10, 20);       System.out.println("DateTime = "+dateTime);       String str = dateTime.format(DateTimeFormatter.ISO_DATE_TIME);       System.out.println("Formatted date = "+str);    } }OutputDateTime = 2019-07-09T10:20 Formatted date = 2019-07-09T10:20:00

Select MySQL Rows Where Column Contains Same Data in More Than One Record

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

586 Views

Use MySQL JOIN to select MySQL rows where column contains same data in more than one record. Let us first create a table −mysql> create table DemoTable (    UserId int,    UserName varchar(20) ); Query OK, 0 rows affected (0.54 sec)Insert records in the table using insert command −mysql> insert into DemoTable values(10, 'John'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values(11, 'Sam'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable values(12, 'Larry'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values(13, 'David'); Query OK, 1 row affected (0.17 ... Read More

Asynchronous Transfer Mode (ATM)

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

6K+ Views

Asynchronous Transfer Mode (ATM) is a switching technique that uses time division multiplexing (TDM) for data communications. It is a network technology that supports voice, video and data communications. ATM encodes data into small fixed − sized cells so that they are suitable for TDM and transmits them over physical medium.The functional reference model of ATM is illustrated as below −FeaturesATM technology provides dynamic bandwidth that is particularly suited for bursty traffic.All data are encoded into identical cells. Hence, data transmission is simple, uniform and predictable. Uniform packet size ensures that mixed traffic is handled efficiently.The size of an ATM ... Read More

Advertisements