Wednesday, 22 January 2014

A Simple Java Class for a MySQL Database

Hello , today i will share with you a Simple Java class used for MySQL aware programs . This class will help you to understand and use simple MySQL queries : select and insert .

You can download the source code here !!!

Before you proceed you will need to : 

  • Install MySQL server
  • Create a user and a password to use
  • Create a  MySQL database : in the mysql console write the following with out the quotes : "CREATE DATABASE dbExample; " then "USE dbExample; " now you will create a simple table to perform your tests " CREATE TABLE myTable (
    id int not null auto_increment,
    name varchar(30) not null,
    surname varchar(30) not null,
    phone varchar(30) not null,
    email varchar(30) not null,
    primary key (id));"
  • Now we have a database and a Table but we have no Data inside :( lets make some data for our database using Java!  (i use NetBeans by the way ) 
  • Unzip the file you downloaded if not already :D
  • Click Open a Project, find and select sqlProgramm
  •  Add the MYSQL JDBC DRIVER in case it does not work : right click on Libraries (in your project) add Library
  • Now you are ready to perform queries using Java: in the SqlProgramm class write : 

  •  Now lets Make a Select all query :

you will see all the data stored in the table :)

Enjoy !!!

Note : You can edit the username and password for MySQL in the sqlQuery class 

In the next Tutorial we will have more functionality :
delete and update  

Saturday, 18 January 2014

Win 7 Optimization Script

Here you can download the script to optimize your windows 7 system.
Before you do anything :
  1. Make sure to do a System Restore point
  2. Download the script
  3. Unzip it
  4. Run the optimize_win7.reg
  5. Reboot your computer 
  6. See the difference your self :)

  What is this script ?

           This script is a .reg file it is a collection of tested settings that can optimize your Win 7 computer.
  1. The startup and shutdown times are reduced
  2. The hard disk (especially if non SSD) can perform better and faster.
  3. Programs that are not responding freeze for less time
  4. The start menu and the explorer are faster

Though i have checked this script in various machines there is always a risk to harm your computer. I have no responsibility for any problem or damage caused by this script.