Krantik Chavan has Published 308 Articles

How many types of JDBC Drivers are there?

Krantik Chavan

Krantik Chavan

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

1K+ Views

There are 4 types of JDBC drivers namely, Type-1, Type-2, Type-3 and, Type-4.Type1 It is the ODBC − JDBC bridge driver, it acts as a bridge between JDBC and, ODBC database connectivity mechanism. Using this you can access the databases which support only ODBC. Initially, it is used extensively, since most ... Read More

What is type1 driver of JDBC what are the advantages and disadvantages of it?

Krantik Chavan

Krantik Chavan

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

1K+ Views

It is the ODBC – JDBC bridge driver, it acts as a bridge between JDBC and, ODBC database connectivity mechanism. Using this you can access the databases which support only ODBC. Initially, it is used extensively, since most of the databases supported only ODBC.Whenever Java application sends a request to ... Read More

Order randomly in MySQL with a random value column?

Krantik Chavan

Krantik Chavan

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

180 Views

Let us first create a table. After that we will create a new random value column and order the record randomly:mysql> create table DemoTable (    StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentName varchar(20) ); Query OK, 0 rows affected (0.57 sec)Following is the query to insert some ... Read More

Is it possible to divide records in both ascending and descending order in MySQL and display them alternatively?

Krantik Chavan

Krantik Chavan

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

61 Views

Yes, you can perform this in MySQL by first getting the middle value. Let us first create a table:mysql> create table DemoTable (    UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY ); Query OK, 0 rows affected (0.65 sec)Following is the query to insert some records in the table using ... Read More

Period isNegative() method in Java

Krantik Chavan

Krantik Chavan

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

161 Views

It can be checked if the days, months and years in the Period are negative or not using the isNegative() method in the Period class in Java. This method requires no parameters. Also, it returns true if any of the days, months and years in the Period are negative and ... Read More

C++ Program to Find Largest Rectangular Area in a Histogram

Krantik Chavan

Krantik Chavan

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

252 Views

This is a C++ Program to find largest Rectangular Area in a HistogramAlgorithmof function getArea():Begin    Create an empty stack.    Initialize the largest_area.    Do a while loop start from first bar for every bar hist[i], where i = 0 to       less than n:    If ... Read More

How to convert std::string to LPCSTR in C++?

Krantik Chavan

Krantik Chavan

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

3K+ Views

In this section we will see how to convert C++ string (std::string) to LPCSTR. The LPCSTR is the (Long Pointer to Constant STRing). It is basically the string like C. So by converting string to character array we can get LPCSTR. This LPCSTR is Microsoft defined. So to use them ... Read More

How to convert std::string to LPCWSTR in C++?

Krantik Chavan

Krantik Chavan

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

3K+ Views

In this section we will see how to convert C++ wide string (std::wstring) to LPCWSTR. The LPCWSTR is the (Long Pointer to Constant Wide STRing). It is basically the string with wide characters. So by converting wide string to wide character array we can get LPCWSTR. This LPCWSTR is Microsoft ... Read More

How to delete all the documents from a collection in MongoDB?

Krantik Chavan

Krantik Chavan

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

537 Views

If you want to delete all documents from the collection, you can use deleteMany(). Let us first create a collection and insert some documents to it:> db.deleteDocumentsDemo.insert({"Name":"Larry", "Age":23}); WriteResult({ "nInserted" : 1 }) > db.deleteDocumentsDemo.insert({"Name":"Mike", "Age":21}); WriteResult({ "nInserted" : 1 }) > db.deleteDocumentsDemo.insert({"Name":"Sam", "Age":24}); WriteResult({ "nInserted" : 1 })Now display ... Read More

How to find length of a string without string.h and loop in C?

Krantik Chavan

Krantik Chavan

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

513 Views

In this section we will see how to find length of a string without using string header file and loops in C. The string length finding problem can be solved without string.h very easily. We can use recursive function to do it.But in this example we are not using recursion. ... Read More

Advertisements