Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials:
 

Software Solutions and Services
 

 
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments
 
JDBC Example with MySQL 
 

Data types of MySQL and Java programming language are not same, its need some mechanism for transferring data between an database using MySQL data types and a application using Java data types.

 

JDBC Example with MySQL

                         

  1. Mapping MySQL Data Types in Java
    Data types of MySQL and Java programming language are not same, its need some mechanism for transferring data between an database using MySQL data types and a application using Java data types.

  2. Connecting to a MySQL Database in Java
    In this section, you will learn how to connect the MySQL database with Java file. We need to establish a connection between MySQL and Java files so that we can use MySQL driver for MySQL. 
                     
  3. Creating a Database in MySQL
    After establishing the connection with MySQL database by using the JDBC driver, you will learn how we can create our database.
                  
  4. Creating a Database Table
    Here, providing you an example with code and it's description that helps you to create a database table in a database through the java file.
                   
  5. Creating a MySQL Database Table to store Java Types
    Dear user, consider a case where we need to store a java types in our database table. This section describes how to create a MySQL database table that stores all java types.
                  
  6. Description of Database Table
    This section introduces you how to get the detailed information about the database table. As we all know that, table has some specific information like: field, type, null etc. 
               
  7. Deleting a Table from Database
    This section describes how to delete a table from database. Java provide the facility for deleting a specific table from a given database with the help of some specified methods.

  8. Retrieving Tables from a Database
    This section provides you a facility for retrieving tables from a specific database through an example. You have to know about a database that is a collection of data or information.

  9. Inserting values in MySQL database table
    Here we are going to see, how we can insert values in the MySQL database table. We know that tables store data in rows and column format. After creating a database table, you insert the values in it. 

  10. Retrieving All Rows from a Database Table
    Here, you will learn how to retrieve all rows from a database table. You know that table contains or stores the data in rows and columns format. If you want to access the data from a table then you need to use some APIs and methods.

  11. Count Rows from a Database Table
    After creating a database table, if we want to know number of rows in a table then we can get it very easily by using the simple database query.
               
  12. Getting Column Names from a database table in Java
    Here, providing you an example with code that retrieves all columns name in a specific database table. Sometimes, you need to know the number of columns and the names of the columns of the table then you can retrieve it with the help of this example.

  13. Adding a New Column in Database Table
    In this jdbc tutorial program we are going to learn about adding a new column in database table. Sometimes it happens that we have created a table and forgets to add some important column name into it.
                
  14. Rename Column Name of a Database Table
    This section provides you an example with code for renaming a column name in a database table. As we know that each table keeps contents in rows and column format.
            
  15. Make Unique key in a Column
    In this section you will learn, how to define a unique key in a column of a database table. While declaring unique key in a column we should check whether this column is eligible to store a unique values or not because if the column has been declared as unique then it can't store a duplicate values.  
                
  16. Remove Unique Key in Database Table
    In this section, we will see how to remove unique field of the particular column in a database table.  We know that, any table stores data in the form of  rows and columns.
                 
  17. Arranging Records of Database Table in Ascending Order
    This section will provide you the facility for arranging the data of database table in ascending order. Firstly we should know what is the meaning of ascending order. The ascending order means an arrangement of data from smallest to largest number in sequence like: 3,6,8,19,21,.........
             
  18. Arranging Records of Database Table in Descending Order
    This section provides an example with code that arrange the records of database table in descending order. The descending order provides a way for arranging records from largest to smallest in a sequence like: 100,85,45,12,.........
             
  19. Sum of Specific Column Data in a Database Table
    This section describes how we can calculate the sum of specific column data in the database table. Consider an example of any university where we need to calculate the sum of  numbers achieved by the student. 
              
  20. Deleting All Rows from a Database Table
    Consider a case where we have been given one database table, now we have to delete all the rows from the table. This section describes for deleting all rows from a specific database table.

  21. Delete a Specific Row from a Database Table
    Consider a case where we are creating a table and we have add some data in it. It may happen that we might add a wrong data in a row, now we need to delete that particular data. This can be done very easily , and in this section we are going to do the same that is, how to delete a specific row from a specific database table.

  22. Delete a Column from a Database Table
    In this section, we are going to learn how to delete a column from a database table. We are not going to create a new table into, and we are expecting that you can make a table yourself.
                       
  23. Join tables in the specific database
    In this section, we are going to consider how to join two or more tables in a specific database. For this you need to have two or more table in the database. If two or more tables are available in the database then Join operation is performed otherwise not.

  24. Join tables with the NATURAL LEFT JOIN operation
    This section describes the NATURAL LEFT JOIN operation and how to retrieve data through it. In this operation we are going to retrieve data according to match the field name of another tables.

  25. Join tables with the NATURAL RIGHT JOIN operation
    This section describes the NATURAL RIGHT JOIN operation of table in a specific database. This operation join tables on the basis of matching fields but priority will be given to the right table field values.

  26. Cross Join Tables in a Specific Database
    This section introduces you to the cross join between two tables. The cross join operation retrieves data between two tables as a Cartesian product of set theory in mathematics. All data show to multiply by each rows.

  27. Prepared Statement Set Object 
    In JDBC tutorial we are going to learn about the PreparedStatement and how to use with setObject method. 
              
  28. Statement Batch Update
    In this section we are going to learn about the batch update and how to use it. Here, we are providing an example with code to execute the statement in a batch. Batch updates means more than one statements are executed or updates simultaneously in the database.
             
  29. Prepared Statement Batch Update
    This section helps to use the prepared statement with batch update and we are going to provide an example that performs batch update facility.
              
  30. Select Records Using Prepared Statement
    In this section we will learn how to select the some specific records by using the PreparedStatement. We know that the PreparedStatement object  represents a precompiled SQL statement.
             
  31. Update Records using Prepared Statement
    The JDBC provides you the facility for updating the records. In this JDBC tutorial we are going to learn about the process of updating the records by using the PreparedStatement.
             
  32. Inserting Records using the Prepared Statement
    In this section we are going to learn how will insert the records in the database table by using the PreparedStatement interface of java.sql package.
                  
  33. Count Records using the Prepared Statement
    In this section we will learn how to count all records of the database table by using the PreparedStatement interface of  java.sql package.
                
  34. Deleting Records using the Prepared Statement
    This section helps us for deleting the records from the database table by using the PreparedStatement interface of the java.sql package.
              
  35. Using the Prepared Statement Twice Time
    This JDBC tutorial helps us for using the PreparedStatement interface of java.sql package twice times in a program. According to our requirement we can use the PreparedStatement object one or more times in a program for different purposes.
                
  36. Set Data Types by using Prepared Statement
    In this section we are going to learn the method for setting data types (String, int, float and double) in the PreparedStatement interface of java.sql package.
                         
  37. Set byte, short and long data types by using the Prepared Statement
    This tutorial teaches you the process of setting the byte, short and long data types in the PreparedStatement interface of the java.sql package.
                
  38. Prepared Statement Set Big Decimal
    In this JDBC section we are going to learn about the big decimal and how can be set it in the database table by using the PreparedStatement interface of java.sql package.

                    
  39. Set Date by using the Prepared Statement
    This JDBC tutorial helps us for setting date in the database table by using the PreparedStatement interface of java.sql package.
                     
  40. Set Time by using the Prepared Statement
    In this section you will learn about setting the time in database table by using the PreparedStatement interface of java.sql package. Suppose you want to insert the actual time in a table, here you will provide a setTime method for setting the time.
                 
  41. Set Timestamp by using the Prepared Statement
    In this JDBC tutorial we will teach how to set the Timestamp in database table by using the PreparedStatement interface of java.sql package. If you want to insert the Timestamp in a table,here you will provide the setTimestamp method that added date and time in the database table by using the  java.util.Date package.
       
  42. Write Text File to Table
    In this section, you will learn how to read the records of a simple text file and write (insert) into a simple table in MySQL database. All records are written in the simple text file and again, if you need to insert these records in tabular format the following example will provide the facility for writing this content.

  43. Copy Table in a MySQL Database  
    In this section, you will learn to copy one table to another in a same MySQL database.
      

  44. Copy One Database Table to Another
    In this section, you will learn to copy one database table to another database table. That means we copy one table to a different table but it contains a similar type of field or column. 
        

  45. Insert Data in Table Using Stored Procedure
    In this example we are inserting data into a table using stored procedure.
           
  46. Inserting Image in Database Table
    In this section, you will learn to insert an image to the MySQL database table. 
              
  47. JDBC Mysql Connection String
    In this Tutorial we want to explain you a code that makes you to understand JDBC MysqlConnection String.

                         

» View all related tutorials
Related Tags: c database orm table data form io sed column remove unique key field columns this tab move row for rows

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

7 comments so far (
post your own) View All Comments Latest 10 Comments:

You guys are simply amazing, I have read most of your tutorials and they are simple superb.

Posted by Harsh on Thursday, 09.25.08 @ 03:55am | #80679

Thats really really gr8 & Useful for a beginner like me, thank's a lot for this, wish you all the best for for your future and i hope that we all beginners may get this type of useful tutorials in the future...
thru this tutorial i think you saved me out of my days frustation and to be get an useless worker in my clients view...

thakns a lot

Posted by sarvesh on Tuesday, 03.4.08 @ 22:00pm | #51329

this is great especially for biginners.

Posted by mnyarugusu on Wednesday, 11.28.07 @ 17:10pm | #40832

How can i express my gratitude and appreciation to you, mere words alone can not convey the joy i felt as i read and reread your tutorial. Believe me, you are the best in making individuals like me understand complicated terminologies and tactics.
In short, please accept my heart-felt genuine thanks.....
I am indebted to yu forever.

Posted by faisal on Monday, 07.9.07 @ 19:07pm | #20978

very helpful for beginners. thank you.

Posted by veeresh on Saturday, 03.24.07 @ 23:31pm | #12621

I read and run the sample apps with great appreciation and joy. Your tutorial is great to start with java and java.sql..Thanks. Kate

Posted by Kate on Wednesday, 02.14.07 @ 05:03am | #7830

Thank u very very very much for giving a very nice example oriented tutorials..
very very nice tutorial for beginners

Posted by r.v.krishna on Wednesday, 02.7.07 @ 13:55pm | #6568

Training Courses
Tell A Friend
Your Friend Name
Website Designing Services
 
Web Designing Packages From $150!
 
Website Designing Company Web Hosting
 
Website Designing Quotation
 
Search Tutorials:

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.