Nancy Den has Published 335 Articles

Exception Handling in C++ vs Java

Nancy Den

Nancy Den

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

472 Views

There are key differences in Exception Handling in C++ vs JavaException handling in javaException handling in C++Only throwable objects can be thrown as objects.All types can be thrown as exceptionIn java, finally is a block that is executed after try catch block for cleaning up.In C++ there is no existence ... Read More

C++ Program to Implement Dijkstra’s Algorithm Using Set

Nancy Den

Nancy Den

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

429 Views

This is a C++ Program to Implement Dijkstra’s Algorithm using Set. Here we need to have two sets. We generate a shortest path tree with given source node as root. One set contains vertices included in shortest path tree and other set includes vertices not yet included in shortest path ... Read More

How to insert images in Database using JDBC?

Nancy Den

Nancy Den

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

4K+ Views

The setBinaryStream() method of the PreparedStatement interface accepts an integer representing the index of the parameter and an InputStream object and sets the parameter to the given InputStream object. Whenever you need to send very large binary value you can use this method.And SQL databases provide a datatype named Blob (Binary ... Read More

C++ Program to Implement First Fit Decreasing for 1-D Objects and M Bins

Nancy Den

Nancy Den

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

101 Views

Here is a C++ Program to implement First Fit Decreasing for 1-D objects and M binsRequired functions and pseudocode:Begin    function binPack() returns number of bins required.    Initialize binC = 0    Initialize an array to store binVal.    Place items one by one.    function sort() to perform ... Read More

Write an JDBC example for inserting value for Blob datatype into a table?

Nancy Den

Nancy Den

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

2K+ Views

Assume we already have a table named MyTable in the database with the following description.+-------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------+------+-----+---------+-------+ | Name | varchar(255) | YES | ... Read More

How can we retrieve a blob datatype from a table using the getBinaryStream() method in JDBC?

Nancy Den

Nancy Den

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

403 Views

The ResultSet interface provides the method named getBlob() to retrieve blob datatype from a table in the database. In addition to this, it also provides a method named getBinaryStream()Like getBlob() this method also accepts an integer representing the index of the column (or, a String value representing the name of ... Read More

The toArray(T[]) method of AbstractSequentialList in Java

Nancy Den

Nancy Den

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

149 Views

The difference between toArray() and toArray(T[] arr) is that both the methods returns an array containing all of the elements in this collection, but the latter has some additional features i.e. the runtime type of the returned array is that of the specified array.The syntax is as follows:public T[] ... Read More

StringStream in C++ for Decimal to Hexadecimal and back

Nancy Den

Nancy Den

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

522 Views

In this section we will see how to convert Decimal to Hexadecimal string and also from Hexadecimal string to Decimal string in C++. For this conversion we are using the stringstream feature of C++.String streams are used for formatting, parsing, converting a string into numeric values etc. The Hex is ... Read More

How to insert an image in to Oracle database using Java program?

Nancy Den

Nancy Den

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

5K+ Views

To hold an image in Oracle database generally blob type is used. Therefore, make sure that you have a table created with a blob datatype as:Name Null? Type ----------------------------------------- -------- ---------------------------- NAME VARCHAR2(255) IMAGE BLOBTo insert an image in to Oracle database, follow the steps given below:Step 1: Connect to ... Read More

What happen if we concatenate two string literals in C++?

Nancy Den

Nancy Den

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

76 Views

In this section we will see another property of string and string literals. If we want to concatenate two strings in C++, we have to remember some of things.If x + y is the expression of string concatenation, where x and y both are string. Then the result of this ... Read More

Advertisements