What are the transaction isolation levels supported by JDBC API?

Arushi
Updated on 30-Jul-2019 22:30:26

1K+ Views

JDBC provides support 5 transaction isolation levels through Connection interface.TRANSACTION_NONE: It is represented by integer value 0 does not support transactions.TRANSACTION_READ_COMMITTED: It is represented by integer value 2 supports transactions allowing Non-Repeatable Reads and, Phantom Reads.TRANSACTION_READ_UNCOMMITTED: It is represented by integer value 1 supports transactions allowing Dirty Reads, Non-Repeatable Reads and, Phantom Reads.TRANSACTION_REPEATABLE_READ: It is represented by integer value 4 supports transactions allowing only Phantom Reads.TRANSACTION_SERIALIZABLE: It is represented by integer value 8 supports transactions with out allowing Dirty Reads, Non-Repeatable Reads and, Phantom Reads.Following JDBC example displays all the transactions levels provided by the Connection interface of the JDBC ... Read More

Printing the correct number of decimal points with cout in C++

Arjun Thakur
Updated on 30-Jul-2019 22:30:26

12K+ Views

Here we will see how to print some floating point numbers up to some pre-defined decimal places. In C++, we can use setprecision with the cout to do this word. This is present under the iomanip header file in C++.Example Code#include #include using namespace std; int main() {    double x = 2.3654789d;    cout

How to add a new row to JTable with insertRow() in Java Swing

Chandu yadav
Updated on 30-Jul-2019 22:30:26

5K+ Views

Let us first create a table with DefaulTabelMode −DefaultTableModel tableModel = new DefaultTableModel(); JTable table = new JTable(tableModel);Now, add a column to the table −tableModel.addColumn("Languages");The insertRow() method will now add a row −tableModel.insertRow(0, new Object[] { "CSS" }); tableModel.insertRow(0, new Object[] { "HTML5" }); tableModel.insertRow(0, new Object[] { "JavaScript" }); tableModel.insertRow(0, new Object[] { "jQuery" });The following is an example to add a new row to JTable −Examplepackage my; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.table.DefaultTableModel; public class SwingDemo {    public static void main(String[] argv) throws Exception {       DefaultTableModel tableModel = new DefaultTableModel();     ... Read More

Get maximum and minimum value in MongoDB?

Anvi Jain
Updated on 30-Jul-2019 22:30:26

1K+ Views

Use $max and $min operator along with aggregate framework to get the maximum and minimum value. Let us first create a collection with documents −> db.maxAndMinDemo.insertOne({"Value":98}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd698a357806ebf1256f129") } > db.maxAndMinDemo.insertOne({"Value":97}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd698af57806ebf1256f12a") } > db.maxAndMinDemo.insertOne({"Value":69}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd698b357806ebf1256f12b") } > db.maxAndMinDemo.insertOne({"Value":96}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd698b657806ebf1256f12c") } > db.maxAndMinDemo.insertOne({"Value":99}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd698b957806ebf1256f12d") }Following is the query to display all documents from a collection with the help of find() method ... Read More

How to read file content into istringstream in C++?

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

1K+ Views

Here is a C++ program to read file content into isstringstream in C++.Example#include #include #include using namespace std; int main() {    ifstream is("a.txt", ios::binary );    // get length of file:    is.seekg (0, std::ios::end);    long length = is.tellg();    is.seekg (0, std::ios::beg);    // allocate memory:    char *buffer = new char [length];    // read data as a block:    is.read (buffer,length);    // create string stream of memory contents    istringstream iss( string( buffer ) );    cout

What is multicasting in Computer Network?

Moumita
Updated on 30-Jul-2019 22:30:26

5K+ Views

Multicasting in computer network is a group communication, where a sender(s) send data to multiple receivers simultaneously. It supports one – to – many and many – to – many data transmission across LANs or WANs. Through the process of multicasting, the communication and processing overhead of sending the same data packet or data frame in minimized.Ethernet MulticastEthernet multicast constitutes multicasting at the data link layer of the OSI model for Ethernet networks. Ethernet frames for multicasting are identified by a 1 bit in the LSB (least significant bit) of the first byte of the destination address.IP MulticastIP multicast provides ... Read More

HTML DOM Input Month name Property

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

64 Views

The HTML DOM input month name property returns and modify the value of the name attribute of the input field of type=”month” in a HTML document.SyntaxFollowing is the syntax −1. Returning nameobject.name2. Modifying nameobject.name = “text”ExampleLet us see an example of HTML DOM input month name property − Live Demo    html{       height:100%;    }    body{       text-align:center;       color:#fff;       background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%)       center/cover no-repeat;       height:100%;    }    p{       font-weight:700;       font-size:1.2rem; ... Read More

acos() function for complex number in C++?

Arnab Chakraborty
Updated on 30-Jul-2019 22:30:26

110 Views

Here we will see the acos() method for the complex numbers. The complex numbers can be used using complex header file. In that header file the acos() function is also present. This is complex version of normal acos() function. This is used to find complex arc cosine of a complex number.This function takes a complex number as input parameter, and returns the arc cosine as output. Let us see one example to get the idea.Example Live Demo#include #include using namespace std; main() {    complex c1(5, 2);    //acos() function for complex number    cout

Java Program to check if none of the string in the list matches the condition

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

552 Views

First, create a List with String elements:List myList = new ArrayList(); myList.add("pqr"); myList.add("stu"); myList.add("vwx"); myList.add("yza"); myList.add("bcd"); myList.add("efg"); myList.add("vwxy");Use the noneMatch() method to check if none of the above string in the myList begins with a specific letter:myList.stream().noneMatch((a) -> a.startsWith("f"));TRUE is returned if none of the string begins with the specific letter, else FALSE.The following is an example to check if none of the string in the list matches the condition:Exampleimport java.util.ArrayList; import java.util.List; public class Demo {    public static void main(final String[] args) {       List myList = new ArrayList();       myList.add("pqr");       ... Read More

How to align JLabel text vertically top in Java?

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

2K+ Views

Use the setVerticalAlignment() method to align JLabel text vertically to the top:JLabel label = label.setVerticalAlignment(JLabel.TOP);The following is an example to align JLabel text vertically to the top:Exampleimport java.awt.Color; import java.awt.Font; import javax.swing.*; import javax.swing.border.Border; public class SwingDemo {    public static void main(String args[]) {       JFrame frame = new JFrame("Demo");       JLabel label;       label = new JLabel("This is demo label!");       label.setFont(new Font("Verdana", Font.PLAIN, 14));       label.setVerticalAlignment(JLabel.TOP);       Border border = BorderFactory.createLineBorder(Color.ORANGE);       label.setBorder(border);       frame.add(label);       frame.setSize(600,300);       frame.setVisible(true);    } }Output

Advertisements