How to Import CSV to Databases In JAVA GUI

Now i will explain how to import your csv to database in JAVA GUI. You must make class java for connect to your database.

1. You must make class java for connect to your database.

makeClassConnect

and this example code for connect to your database.

connectClass

2. Make new Jframe class and put two Jbutton on your jframe.

ImportCsvClass

3. We make filechooser for take your csv file.

eventChooseFile

and  the code for filechooser

filechooser

4. after that, we make import for import csv to database.

eventImport

 

and the code for import csv

codeImport

and this all code for class import.

codeClass

5. make sample CSV file.

TestingCSV

6. Import CSV file and check on your database.

Before I import

mysqlbfore

After I import

mysqlafter

sorry for my bad english. i hope usefull

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s