Nitya Raut has Published 156 Articles

Delete duplicate alphanumeric entries from column data in SQL

Nitya Raut

Nitya Raut

Updated on 18-Dec-2019 10:05:14

217 Views

You can opt for using regular expressions to remove the duplicate numbers from column c or any other intended column.ExampleSELECT REPLACE_REGEXPR ('([A-Za-z0-9])\1+' in 'BB11222343CC'    WITH '\1'    OCCURRENCE ALL) FROM OutputB12343C

How to use Singleton with Global Context in android?

Nitya Raut

Nitya Raut

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

913 Views

Before getting into example, we should know what singleton design patter is. A singleton is a design pattern that restricts the instantiation of a class to only one instance. Notable uses include controlling concurrency, and creating a central point of access for an application to access its data store.This example ... Read More

How to get the number of records in a table using JDBC?

Nitya Raut

Nitya Raut

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

542 Views

The ResultSet class doesn’t provide any direct method to get the number of records in a table.The beforeFirst() method navigates the pointer/curser of the ResultSet object to its default position before first.In the same way the last() method positions the cursor at the last row of the ResultSet object.Using these ... Read More

How to get the size of a column of a table using JDBC?

Nitya Raut

Nitya Raut

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

2K+ Views

You can get the size of a column of a table using the getPrecision() method of the ResultSetMetaData class.//Retrieving the ResultSetMetaData object ResultSetMetaData rsmd = rs.getMetaData(); //getting the column type int size_name = rsmd. getPrecision(3);Assume we have a table named employee_data in the database with description as shown below:+----------+--------------+------+-----+---------+-------+ ... Read More

How to find tables modified in the last hour in Android sqlite?

Nitya Raut

Nitya Raut

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

217 Views

Before getting into example, we should know what sqlite data base in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to ... Read More

Determine the type of an image in Python?

Nitya Raut

Nitya Raut

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

4K+ Views

In this section we are going to see the type of image file we have. So consider a situation, where in a directory we have hundreds of image file and we want to get all the jgeg(or any particular image file type) file type. All this we are going to ... Read More

How to delete a row from ResultSet object using JDBC?

Nitya Raut

Nitya Raut

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

1K+ Views

The deleteRow() method of the ResultSet interface deletes the current row from the current ResultSet object.//Deleting a column from the ResultSet object rs.deleteRow();Assume we have a table named Cricketers_Data with 6 records as shown below:+----+------------+------------+---------------+----------------+-------------+ | ID | First_Name | Last_Name  | Year_Of_Birth | Place_Of_Birth | Country     | ... Read More

How to get yesterday records from timestamp in Android sqlite?

Nitya Raut

Nitya Raut

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

277 Views

Before getting into example, we should know what sqlite data base in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to ... Read More

How to enable vertical scroll bar for android webview?

Nitya Raut

Nitya Raut

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

3K+ Views

This example demonstrate about How to set default text encoded for android webview.Step 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. ... Read More

How to find the current row of a ResultSet object using JDBC?

Nitya Raut

Nitya Raut

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

775 Views

The getRow() method of the ResultSet class returns the row number at which the ResultSet pointer exists in the current instance.Assume we have a table named cricketers_data with 6 records as shown below:+------------+------------+---------------+----------------+-------------+ | First_Name | Last_Name  | Date_Of_Birth | Place_Of_Birth | Country     | +------------+------------+---------------+----------------+-------------+ | Shikhar   ... Read More

Previous 1 ... 5 6 7 8 9 ... 16 Next
Advertisements