This is the continuation of the previous tutorial I had, Connecting PostgreSQL to Netbeans – Part 1. Now, we will be accessing our database in PostgreSQL via our Netbeans platform.
Stretch your patience with this one, especially in the coding part.
1. As you open your Netbeans, got to File > New Project > Categories: Java > Projects: Java Application. Then click Next.
2. Fill in your Project Name, then click Finish.
3. Go to your project, mine is named trylang. Right click Libraries, and Add Library.
4. A pop-up will appear, choose PostgreSQL JDBC Driver.
5. Then clear the source file and fill it with the code that will eventually connect your database to your Netbeans. The code can be downloaded in this file hosting site. Warning: you have to replace the variables in the code with your own in your database; it’s because it will surely cause errors.
6. Finally, after pasting and editing the code, Run the code. Then you will get a pop-up window displaying the content of your table you created in PostgreSQL.

There you have it, you’ve just accessed your database in PostgreSQL using Netbeans. You could actually edit the columns of your table, and rerun the source code. You will then get an updated call.
Domo arigato! XD

3. Go to Databases > Postgres > Schemas > Public > Table. Right click the Table, and choose New Table.
4. You will get to the table pane. Name your table, and leave the other as blank.
5. Go to Columns, and click the Add button below.
6. This time, you will be adding the columns of your table. Type the name of your table. Fill the Data type as text. Check the box of Not NULL.
7. Keep on adding more columns until you reach your desired number of columns.
8. Then you need to go to Constraints, just beside the Columns.
9. Choose any column as a constraint, and add it. Then click OK.
10. Now, you need to go to the left sidebar. Go to Tables > the name of your table, mine is Author. Then, right click the named table, click Scripts > INSERT script.
12. Now, go back to your named table, mine is Author. Right click it, then go to View Data > View All Rows. A window will appear with the populated query. It means, you are successful!

3. Then choose your Installation Directory and Data Directory, but you could select the default path just by clicking the Next button.
5. Key in 5432 for the Port.
6. Just click the Next button for the Locale.
7. Then wait while the Setup installs.
8. Tadaaan! And you’re now finished installing your PostGreSQL. [Congrats! Pastel naman dyan.]


WEDDING OF THE MOMENT. The long wait is going to end inside in the church. Witness the Tan-Lopez Nuptial.
CHEAP TOYS? Come and avail of imported toys at very reasonable price.