devxlogo

Tip Bank

Get the End Date of a Financial Quarter

Often, in financial applications, the quarter end date is very important for financial calculations. The following function gets the end date of a Financial Quarter that is relative to the

Extract the Contents of ZIP/JAR Files Programmatically

Suppose jarFile is the jar/zip file to be extracted. destDir is the path where it will be extracted: java.util.jar.JarFile jar = new java.util.jar.JarFile(jarFile);java.util.Enumeration enum = jar.entries();while (enum.hasMoreElements()) { java.util.jar.JarEntry file

Simplify Operator Overloading

For beginning C++ programmers, operator overloading may seem like a complicated task, but in fact, it’s really simple. You can overload operators in two ways: On non-member functions. On member

Use Oracle’s VARRAY Through JDBC

This code snippet demonstrates how to use Oracle’s VARRAY through JDBC. The code: Creates VARRAYs of different lengths. Contains a table to store data of above array type. Stores the

Uploading a Large Number of Records in DB2

When you’re carrying out an database-intensive operations, like trying to insert a lot of records in one transaction or opening a bunch of connections at the same time, you run

Create and Retrieve a Named DataSet

This C# function creates and retrieves a named DataSet using an open connection and a command. public System.Data.DataSet dsReturnedDataSetFrom(System.Data.SqlClient.SqlConnectionsqlOpenConn, System.Data.SqlClient.SqlCommand TheSQLCommand, string TheQueriedTable, stringTheDatasetName){TheSQLCommand.Connection = sqlOpenConn;System.Data.SqlClient.SqlDataAdapter NewDA = new System.Data.SqlClient.SqlDataAdapter(TheSQLCommand);DataSet

Using Vectors

When you’re learning about data structures, you’ll come across a very useful class called vector. It’s basically an array, but it stores its elements dynamically. That means that it can