Vikyath Ram has Published 178 Answers

Java ResultSet isClosed() method with example

Vikyath Ram

Vikyath Ram

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

When we execute certain SQL queries (SELECT query in general) they return tabular data.The java.sql.ResultSet interface represents such tabular data returned by the SQL statements.i.e. the ResultSet object holds the tabular data returned by the methods that execute the statements which quires the database (executeQuery() method of the Statement interface in general).The ... Read More

How to move the ResultSet cursor to the next row in JDBC?

Vikyath Ram

Vikyath Ram

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

Whenever we execute SQL statements using the executeQuery() method, it returns a ResultSet object which holds the tabular data returned by the SELECT queries(in general).The ResultSet object contains a cursor/pointer which points to the current row. Initially this cursor is positioned before first row (default position).You can move the cursor of the ... Read More

How to move the ResultSet cursor to the first row in JDBC?

Vikyath Ram

Vikyath Ram

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

Whenever we execute SQL statements using the executeQuery() method, it returns a ResultSet object which holds the tabular data returned by the SELECT queries(in general).The ResultSet object contains a cursor/pointer which points to the current row. Initially this cursor is positioned before first row (default position).You can move the cursor ... Read More

How to get the list of all databases using JDBC?

Vikyath Ram

Vikyath Ram

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

You can get the list of databases in MySQL using the SHOW DATABASES query.show databases;Following JDBC program retrieves the list of databases by executing the show databases query.Exampleimport java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class ShowDatabasesExample {    public static void main(String args[]) throws Exception {     ... Read More

How to get column count in a ResultSet in JDBC?

Vikyath Ram

Vikyath Ram

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

You can get the column count in a table using the getColumnCount() method of the ResultSetMetaData interface. On invoking, this method returns an integer representing the number of columns in the table in the current ResultSet object.//Retrieving the ResultSetMetaData object ResultSetMetaData rsmd = rs.getMetaData(); //getting the column type int column_count = rsmd.getColumnCount();Let us ... Read More

Multi-access Channels and Random Access Channels

Vikyath Ram

Vikyath Ram

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

Multi-access ChannelsMulti-access channels are network channels that allow several transmitters to communicate with a common receiver via a shared channel. These channels are also called multiple access (MAC) channels. The network channel may be a single cable or optical fiber connecting multiple nodes, or a portion of the wireless spectrum.Random ... Read More

How to create a table in Oracle using JDBC?

Vikyath Ram

Vikyath Ram

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

You can create a table in a database using the CREATE TABLE query.SyntaxCREATE TABLE table_name(    column1 datatype,    column2 datatype,    column3 datatype,    .....    columnN datatype,    PRIMARY KEY( one or more columns ) );To create a table in a database using JDBC API you need to ... Read More

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

Vikyath Ram

Vikyath Ram

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

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 ... Read More

How to count rows – count (*) and Java

Vikyath Ram

Vikyath Ram

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

The SQL Count() function returns the number of rows in a table. Using this you can get the number of rows in a table.select count(*) from TABLE_NAME;Let us create a table with name cricketers_data in MySQL database using CREATE statement as shown below −CREATE TABLE cricketers_data(    First_Name VARCHAR(255),    Last_Name VARCHAR(255),   ... Read More

Bit-Map Protocol

Vikyath Ram

Vikyath Ram

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

Bit-map protocol is a collision free protocol that operates in the Medium Access Control (MAC) layer of the OSI model. It resolves any possibility of collisions while multiple stations are contending for acquiring a shared channel for transmission.In this protocol, if a station wishes to transmit, it broadcasts itself before ... Read More

Advertisements