Found 7442 Articles for Java

What is CONCUR_UPDATABLE ResultSet in JDBC? Explain?

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

What is ResultSet Concurrency in JDBC?

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

2K+ Views

The concurrency of the ResultSet object determines whether its contents can be updated or not.The Connection interface provides 3 variants of the createStatement() method where one of the method's signature is as follows:Statement createStatement(int resultSetType, int resultSetConcurrency)This method accepts two integer type variables where one represents the type of the ResultSet and the other represents the Concurrency of the ResultSet.The ResultSet interface provides two values to specify the concurrency of the ResultSet.CONCUR_READ_ONLY: If you set this as a value of the concurrency while creating the ResultSet object you cannot update the contents of the ResultSet you can only read/retrieve them.CONCUR_UPDATABLE: ... Read More

What is the difference between the TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE ResultSets in JDBC?

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

2K+ Views

In the TYPE_SCROLL_INSENSITIVE ResultSet, the cursor moves in forward or backward directions. This type of ResultSet is insensitive to the changes that are made in the database i.e. the modifications done in the database are not reflected in the ResultSet.Which means if we have established a connection with a database using a JDBC program and retrieved a ResultSet holding all the records in a table named SampleTable. Meanwhile, if we have added some more records to the table (after retrieving getting the ResultSet), these recent changes will not be reflected in the ResultSet object we previously obtained.In the TYPE_SCROLL_SENSITIVE ResultSet, ... Read More

What is TYPE_SCROLL_SENSITIVE ResultSet in JDBC?

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

4K+ Views

This represents is a scrollable ResultSet i.e. the cursor moves in forward or backward directions. This type of ResultSet is sensitive to the changes that are made in the database i.e. the modifications done in the database are reflected in the ResultSet.Which means if we have established a connection with a database using a JDBC program and retrieved a ResultSet holding all the records in a table named SampleTable. Meanwhile, if we have added some more records to the table (after retrieving the ResultSet), these recent changes will be reflected in the ResultSet object we previously obtained.Following is an example ... Read More

What is TYPE_SCROLL_INSENSITIVE ResultSet in JDBC?

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

2K+ Views

This represents a scrollable ResultSet i.e. the cursor moves in forward or backward directions. This type of ResultSet is insensitive to the changes that are made in the database i.e. the modifications done in the database are not reflected in the ResultSet.Which means if we have established a connection with a database using JDBC program and retrieved a ResultSet holding all the records in a table named SampleTable and, meanwhile if we add some more records to the table (after retrieving getting the ResultSet), these recent changes will not be reflected in the ResultSet object we previously obtained.ExampleConsider we have ... Read More

What is Type_FORWARD_ONLY ResultSet in JDBC?

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

3K+ Views

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 the first row.You can retrieve the column value at the current row using the getter methods getInt(), getString(), getDate() etc…To move the cursor and to navigate/iterate through the ResultSet the java.sql.ResultSet interface provides various methods such as next(), Previous(), first(), last(), relative(), absolute(), beforeFirst(), afterLast() etc...Type_FORWARD_ONLY Only ResultSetIn forward only ResultSet you can move the cursor only in forward direction. By default, a ResultSet is of type forward only.Read More

How to check index within a string of a specified substring in JSP?

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

526 Views

The fn:indexOf() function returns the index within a string of a specified substring.SyntaxThe fn:indexOf() function has the following syntax −int indexOf(java.lang.String, java.lang.String)ExampleFollowing is the example to explain the functionality of the fn:indexOf() function − Using JSTL Functions Index (1) : ${fn:indexOf(string1, "first")} Index (2) : ${fn:indexOf(string2, "second")} You will receive the following result −Index (1) : 8 Index (2) : 13

How to escape characters that can be interpreted as XML markup in JSP?

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

1K+ Views

The fn:escapeXml() function escapes characters that can be interpreted as XML markup.SyntaxThe fn:escapeXml() function has the following syntax −java.lang.String escapeXml(java.lang.String)ExampleFollowing is the example to explain the functionality of the fn:escapeXml() function − Using JSTL Functions With escapeXml() Function: string (1) : ${fn:escapeXml(string1)} string (2) : ${fn:escapeXml(string2)} Without escapeXml() Function: string (1) : ${string1} string (2) : ${string2} You will receive the following result −With escapeXml() Function: string (1) : This is first String. string (2) : This is second String. Without escapeXml() Function − string (1) : This is first String. string (2) : This is second String.

How to determine if an input string ends with a specified suffix in JSP?

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

326 Views

The fn:endsWith() function determines if an input string ends with a specified suffix.SyntaxThe fn:endsWith() function has the following syntax −boolean endsWith(java.lang.String, java.lang.String)ExampleFollowing example explains the functionality of the fn:substring function −           Using JSTL Functions                              String ends with 123                      String ends with TEST       You will receive the following result −String ends with 123

How to check whether an input string contains a specified substring ignoring the case using JSP?

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

406 Views

The fn:containsIgnoreCase() function determines whether an input string contains a specified substring. While doing search it ignores the case.SyntaxThe fn:containsIgnoreCase() function has the following syntax −boolean containsIgnoreCase(java.lang.String, java.lang.String)ExampleFollowing is the example to explain the functionality of the fn:containsIgnoreCase() function −           Using JSTL Functions                              Found test string                      Found TEST string         You will receive the following result −Found test string Found TEST string

Advertisements