JDBC Tutorial for Beginners #7 : Creating a database table from java Program

Java

Video is ready, Click Here to View ×


In the beginning of this tutorial, we have used MySQL workbench for creating tables. In this video, I have explained how to make database table from the program itself.

In order to execute custom operations, we can make use of statement.execute() method. Using normal sql CREATE TABLE command, we can create new table.

This tutorial series covers following topics
■ Connecting Java Program to MySQL Database
■ Inserting data into database
■ Fetching data from database
■ Updating…

2 thoughts on “JDBC Tutorial for Beginners #7 : Creating a database table from java Program

  1. i'm trying to write this one on the jTextArea,
    but i have got null

    String sql = jTextArea1.getText();
    stmt = connection.createStatement();
    stmt.execute(sql);
    System.out.println("Table Created!!!");

Leave a Reply

Your email address will not be published. Required fields are marked *