Explore your Imagination

Blog of Joeby Zaldivar Keep in touch…


How to bind jtable from your database table using netbeans

1. Create a JFrame that holds your Jtable...

2. From Pallete click and drag Jtable to the JFrame.

. Click Jtable to be selected and right click then choose bind -> elements then click.

4. Window for binding jtable will popup.  click import data from button. Select new connection for connection string is not set in the selection and click.  Select the driver name according to your chosen database.

5. Fill-up neccessary data according to machine configuration. Then click ok.  window popup that display your connection and selection of table to be bind in jtable. Then click ok and wait for data to import.

6.From Left portion of the window are those fields that are available and from the right are fields that are selected to view in the jtable. Then click ok and compile and run your program...


Happy coding....  


How to Connect MySQL DB on PHP

// Database Constants

// Checks whether a given named constant exists   if   null then it define the given constant variable.
defined('DB_SERVER') ? null : define("DB_SERVER", "localhost");
defined('DB_USER')   ? null : define("DB_USER", "root");
defined('DB_PASS')   ? null : define("DB_PASS", "password");
defined('DB_NAME')   ? null : define("DB_NAME", "my_db");
$connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS);
if (!$connection) {
die("Database connection failed: " . mysql_error());
} else {
$db_select = mysql_select_db(DB_NAME, $this->connection);
if (!$db_select) {
die("Database selection failed: " . mysql_error());