Found 33676 Articles for Programming

How to create a Stored procedure in a database using JDBC API?

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

3K+ Views

A. Stored procedures are sub routines, segment of SQL statements which are stored in SQL catalog. All the applications that can access Relational databases (Java, Python, PHP etc.), can access stored procedures.Stored procedures contain IN and OUT parameters or both. They may return result sets in case you use SELECT statements. Stored procedures can return multiple result sets.To create a stored procedure in (MySQL) a database using JDBC API you need to:Register the driver: Register the driver class using the registerDriver() method of the DriverManager class. Pass the driver class name to it, as parameter.Establish a connection: Connect ot the database ... Read More

How to remove a record from an existing table in a database using JDBC API?

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

377 Views

You can remove a particular record from a table in a database using the DELETE query.SyntaxDELETE FROM table_name WHERE [condition];To delete a record from a table using JDBC API you need to:Register the driver: Register the driver class using the registerDriver() method of the DriverManager class. Pass the driver class name to it, as parameter.Establish a connection: Connect ot the database using the getConnection() method of the DriverManager class. Passing URL (String), username (String), password (String) as parameters to it.Create Statement: Create a Statement object using the createStatement() method of the Connection interface.Execute the Query: Execute the query using the executeUpdate() method of ... Read More

C++ Program to Perform Left Rotation on a Binary Search Tree

Farhan Muhamed
Updated on 22-May-2025 18:04:56

2K+ Views

A Binary Search Tree (BST) is a sorted binary tree in which each node follows two key properties: The right subtree of a node contains only keys greater than the node's key. The left subtree of a node contains only keys less than the node's key. Additionally, each node has at most two children. Tree Rotation Tree rotation is an operation that changes the structure without interfering with the order of the elements on a binary tree. It moves one node up in the tree and one node down. ... Read More

How to update the contents of a record of a table in a database using JDBC API?

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

260 Views

A. You can update/modify the existing contents of a record in a table using the UPDATE query. Using this you can update all the records of the table or specific records.SyntaxUPDATE table_name SET column1 = value1, column2 = value2...., columnN = valueN WHERE [condition];To update the contents of a record in a table using JDBC API you need to:Register the driver: Register the driver class using the registerDriver() method of the DriverManager class. Pass the driver class name to it, as parameter.Establish a connection: Connect ot the database using the getConnection() method of the DriverManager class. Passing URL (String), username (String), password ... Read More

C++ Program to Perform Inorder Non-Recursive Traversal of a Given Binary Tree

Farhan Muhamed
Updated on 15-May-2025 19:35:41

776 Views

Binary Tree traversal is a process of visiting all the nodes in a certain order. In this article, we will learn how to perform inorder non-recursive traversal of a binary tree using a stack in C++. What is Inorder Non-Recursive Traversal? Inorder traversal is a type of tree traversal, where we first visit the left subtree, then the root node, and then the right subtree. In a non-recursive approach, we are not allowed to use recursive functions to track nodes for traversing the tree. Instead, we can use an explicit stack data structure to track nodes and traverse through ... Read More

How to retrieve a record from an existing table in a database using JDBC API?

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

979 Views

A. You can read/fetch the contents of a record in a table using the SELECT query. This will return data in the form of a result table and, these result tables are called result-sets.SyntaxSELECT column1, column2, columnN FROM table_name; Or, SELECT * FROM table_name;To retrieve the contents of a row of a table using JDBC API you need to:Register the driver: Register the driver class using the registerDriver() method of the DriverManager class. Pass the driver class name to it, as parameter.Establish a connection: Connect ot the database using the getConnection() method of the DriverManager class. Passing URL (String), username (String), password ... Read More

C++ Program to Perform Dictionary Operations in a Binary Search Tree

Farhan Muhamed
Updated on 15-May-2025 19:35:26

2K+ Views

A dictionary is a collection of key-value pairs where, keys are unique and used to identify corresponding values in the dictionary. In this article, we will learn how to perform dictionary operations such as insertion, search, and traversal using a binary search tree (BST) in C++. What is BST? A binary search tree (BST) is a tree data structure, where each node has at most two children and follows two rules: the left subtree contains keys less than the node’s key, and the right subtree contains keys greater than the node’s key. This structure is same as how a ... Read More

C++ Program to Implement Ternary Tree

Farhan Muhamed
Updated on 23-May-2025 11:18:01

681 Views

A ternary tree is a type of tree data structure in which each node can have at most three children. In this article, we will learn how to implement a ternary tree in C++ using basic class structures and pointers. What is Ternary Tree? A ternary tree is a tree in which each node has up to three children, that is left, middle, and right. It is same as a binary tree, but with an extra child node for each node. Each node in a ternary tree stores a data value and pointers to its three child nodes. ... Read More

How to insert a record into a table in a database using JDBC API?

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

1K+ Views

A. You can insert records in to a table using the INSERT query.SyntaxINSERT INTO TABLE_NAME (column1, column2, column3, ...columnN) VALUES (value1, value2, value3, ...valueN); Or, INSERT INTO TABLE_NAME VALUES (value1, value2, value3, ...valueN);To insert a record into a table in a database using JDBC API you need to:Register the driver: Register the driver class using the registerDriver() method of the DriverManager class. Pass the driver class name to it, as parameter.Establish a connection: Connect ot the database using the getConnection() method of the DriverManager class. Passing URL (String), username (String), password (String) as parameters to it.Create Statement: Create a Statement object using ... Read More

What is the easiest way to convert int to string in C++

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

436 Views

In this section, we will see how to convert an integer to a string.The logic is very simple. Here we will use the sprintf() function. This function is used to print some value or line into a string, but not in the console. This is the only difference between printf() and sprintf(). Here the first argument is the string buffer. where we want to save our data.Input: User will put some numeric value say 42 Output: This program will return the string equivalent result of that number like “42”AlgorithmStep 1: Take a number from the user Step 2: Create an ... Read More

Advertisements