×
Home
Jobs
Tools
Coding Ground
Current Affairs
UPSC Notes
Online Tutors
Whiteboard
Net Meeting
Tutorix
Login
Packages
Categories
Java
JSP
iOS
HTML
Android
Python
C Programming
C++ Programming
C#
PHP
CSS
Javascript
jQuery
SAP
SAP HANA
Data Structure
RDBMS
MySQL
Mathematics
8085 Microprocessor
Operating System
Digital Electronics
Analysis of Algorithms
Mobile Development
Front End
Web Development
Selenium
MongoDB
Computer Network
General Topics
Library
Videos
Q/A
eBooks
Login
Library
Videos
eBooks
Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Selected Reading
UPSC IAS Exams Notes
Developer's Best Practices
Questions and Answers
Effective Resume Writing
HR Interview Questions
Computer Glossary
Who is Who
Vikyath Ram
has Published
178
Answers
How to count rows – count (*) and Java
JDBC
Java 8
Object Oriented Programming
Programming
Vikyath Ram
Published on 16-May-2019 14:37:19
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
How to remove a record from an existing table in oracle database using JDBC API?
JDBC
Java 8
Object Oriented Programming
Programming
Database
Vikyath Ram
Published on 16-May-2019 14:23:30
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 create a table in Oracle using JDBC?
JDBC
Java 8
Object Oriented Programming
Programming
Vikyath Ram
Published on 16-May-2019 12:37:43
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 get column count in a ResultSet in JDBC?
JDBC
Java 8
Object Oriented Programming
Programming
Vikyath Ram
Published on 16-May-2019 12:18:16
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
How to get the list of all databases using JDBC?
JDBC
Java 8
Object Oriented Programming
Programming
Vikyath Ram
Published on 16-May-2019 12:09:37
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 do you check if a ResultSet is empty or not in JDBC?
JDBC
Java 8
Object Oriented Programming
Programming
Vikyath Ram
Published on 15-May-2019 16:59:49
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).The next() methodThe next() method of ...
Read More
How to move the ResultSet cursor to the first row in JDBC?
JDBC
Java 8
Object Oriented Programming
Programming
Vikyath Ram
Published on 15-May-2019 16:46:40
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 move the ResultSet cursor to the next row in JDBC?
JDBC
Java 8
Object Oriented Programming
Programming
Vikyath Ram
Published on 15-May-2019 16:31:57
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
Java ResultSet isClosed() method with example
JDBC
Java 8
Object Oriented Programming
Programming
Vikyath Ram
Published on 15-May-2019 16:14:46
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
Java ResultSet isLast() method with example
JDBC
Java 8
Object Oriented Programming
Programming
Vikyath Ram
Published on 15-May-2019 16:10:56
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 ResultSet ...
Read More
1
2
3
4
5
6
7
...
18
Next
Advertisements
Print
Add Notes
Bookmark this page
Report Error
Suggestions
Save
Close
Dashboard
Logout