Saturday, April 9, 2011

Jdbc is the Application Programming Interface (API)



JDBC is the Application Programming Interface (API) designed for universal access database based on SQL. JDBC consists atsa JDBC 1.0 API that provides basic functionality for data access. JDBC 2.0 API adds to the basic functions with other advantages which more sophisticated. JDBC JDBC API is a trade mark name, not an acronym. But often mistaken for JDBC stands for Java Database Connectivity. JDBC API consists of a number of classes and interfaces written in Java which provides a standard API as a tool for programmers and provides the possibility to write database applications using any Java API. JDBC API makes it easy to send SQL statements to relational database systems and supports a variety of SQL language. Advantage JDBC API is an application can access any data source and can run on any platform that has Java Virtual Machine (JVM). So we do not have to write one program for accessing the Sybase database, Oracle or Access and others. We simply write a program that uses the JDBC API, and the program can send the SQL statement or other statement to a particular data source. With applications written in Java language one does not have to worry about writing different applications to run on different platforms. What does JDBC? JDBC technology is able to do three things: 1. Establish a connection to a data source (data source). 2. Send a statement to the source data. 3. Processing the results of the model statement 2-tier and 3-tier to access the database, JDBC API supports both 2-tier model and 3-tier. For 2-tier model, an applet or java application speaks directly to the database. In this case the required JDBC driver that can communicate to the source data. A command or statement from the user are sent to the database and the results of statements sent back to the user. The database can be located on the same machine or different from the client, which is connected to a network. If the location of the database is different from the client machine so-called client / server. Called the client user's machine and the machine where the database is called a server. This network can be a LAN or the Internet. In a 3-tier model, user send commands to a middle tier. Furthermore, middle tier sends commands to the database. Database to process the order and sends back the results to the middle tier. Then send it to the user's middle tier. The advantage of this 3-tier model is easier for deployed applications and improve performance. JDBC Driver Types JDBC API consists of two main interfaces, the first is the JDBC API for application writers, and the second is lower-level JDBC driver API for driver writers. Technology JDBC drivers can be divided into four categories: 1. JDBC-ODBC Bridge plus ODBC Driver This combination produces JDBC access via ODBC drivers. Bridging between Java applications with the Microsoft ODBC. This driver type is best suited for a corporate network where client installations are not big problems, or for server applications written in Java language in a 3-tier architecture. 2. Native API party Java technology-enabled driver converts JDBC Type this driver call into the client API for Oracle, Sybase, Informix, DB2, and other DBMS. This type requires a specific binary code of the operating system is loaded into each client. 3.Pure Driver for Database Middleware Java (JDBC-Net) Model this driver translates JDBC calls into the middleware vendor protocol, which is then translated to a DBMS protocol by a middleware server. Middleware provides connectivity to a variety of different types of databases. 4.Native-protocol Pure Java Driver Model driver converts JDBC calls directly into the network protocol used by the DBMS, allowing a direct call from a client machine to the DBMS server and providing practical solutions for Internet access.

Data Sources

// register a data source
DataSource?Class dso = new DataSource?Class(); // Implements DataSource?
dso.setServerName("SOME_SERVER");
dso.setDatabaseName("SOME_DATABASE");
Context ic = new InitialContext();
// Register dso as e named DataSource?
ic.bind("jdbc/SOME_DATABASE", dso);
...
// Querying for a DataSource?
Context ic = new InitialContext();
DataSource ds = (DataSource?) ic.lookup("jdbc/SOME_DATABASE");
// make a connection
Connection con = ds.getConnection("username", "pasword");


READ MORE - Jdbc is the Application Programming Interface (API)

Sunday, April 3, 2011

standard OSI has 7 layers

ften used for data communications is the OSI (Open Systems Interconecting)

so with this application every computer with different operating systems will be able to communicate fluently and global data.
Another advantage to the vendor side of this standard will vendors promise their products will sell in the market.

standard OSI has 7 layers, seven layers has a function and responsibility of their own.
1. bottom layer is the physical layer, which is useful for
physical connection (cabling using RJ45)
2. data link layer (layer works on the side of the modem where
function to perform modulation and demodulation)
3. network layer (network layer)
4. transport layer (Serves for reliable data transfer,
responsible for the integrity of data in data transmission
data exchange in the relationship between transmitter
and receiver)
5. session layer (Serves to control the communication between
application, build, maintain and terminate sessions between
application)
6. presentation layer (Serves to overcome differences
data format, compression, and encryption of data)
7. application layer (As a user interface to the OSI environment,
examples of application layer is the e-mail, ftp and http).

example of data communication is the Internet.
with any Internet connection worldwide data exchange easier.
although different operating systems (Windows, Linux, MacOS, OS / 2, BSD) all can make data communications.
for all operating systems and devices to follow ISO standards that OSI.
READ MORE - standard OSI has 7 layers

Types of Data Communications Applications

Data communication is the process of sending and receiving data / information from two or more devices / equipment, such as computers / laptops / printers / other communication devices are connected in a network, both local and broad, such as the Internet.

Two types of data communication:
1. Through Terrestrial Infrastructure
2. Through Satellite

application:
a. Checking your credit card online.
b. The transfer of funds from one bank to another electronically.
c. Automatic Payment Machine (automatic telling machines = ATM).
d. Electronic sales system (purchase of goods which are automatically handled by the bank account).
e. e-mail
f. Systems such as Prestel Text Video
g. Fax System
h. Transaction Processing

Types of Data Communications Applications

Data Collection, data can be collected from several places (remote station), stored in memory and at certain times these data will be processed. Example: payroll inventory application

Inquiry and Response, the user can access directly to the file or program. The data that is sent to the computer system can be immediately processed and the results can be immediately given. When users conduct a dialogue with the computer system is called interactive. Examples: banking application, payment dipertokoan

Storage and Retrival, data previously stored in a computer can be taken at any time by the parties concerned without being limited distance, for example: online data storage or in an email.

Time Sharing, a user can complete the program together. Each user is given the opportunity to work for a certain period a fixed amount, after which other users are given the opportunity to work on. Example: the application user computer systems together for software development.

Jon Remote Entry, Remote Terminal Job transmit programs or data (text) to be stored to a central computer where data is processed. The program was done in batches, which is processed after the turn came. Example: a web application

Real Time Data Processing and Process Control, the desired process results in a timely manner with the interests of that process (real time). For example: Google Maps
Data Exchange Among Computers, the exchange of data in the form of programs, files and so forth between computer systems.
READ MORE - Types of Data Communications Applications

Wednesday, March 30, 2011

Building a Router at Home With Ubuntu


Building a Router at Home With Ubuntu
Many homes now have Internet access independent. Some of them even had to use a broadband connection with a fairly high speed. The question is, Can the Internet connection is being shared to multiple PCs or notebooks at home? The answer could be, with the router!

Router that will be made - though for home-based classes - guaranteed to have stability and enterprise-class security as supported by the Linux operating system. Eits, do allergies first with Linux. Linux is intentionally selected from Ubuntu Desktop - the easiest Linux distributions and is widely used as a working terminal. We assure you, you baseball will meet with the Linux command line is much feared by ordinary users.

Here we will use the Desktop versions of Ubuntu Linux 8.10 (Intrepid Ibex). But underneath the version of Ubuntu users are also fixed to follow the same steps. Oh yes, the router that we will make use Firestarter application (www.fs-security.com) who has a 100% license free. Originally, this application is a firewall router features. So your router will have a firewall facilities. Fun, right?

Let's get started. As a first step, prepare a PC that had been installed Ubuntu and have an active Internet connection so you can browse there. Do not forget to also provide an additional network card to connect Ubuntu to the local network.

Installation of Main Components

1. There are two main components that must be installed before we can enable the PC as a router, that is Firestarter and DHCP (Dynamic Host Configuration Protocol). DHCP component need only be installed if you want an IP address automatically allocated to clients. If you want to configure the address manually, DHCP is not required to be installed. To install Firestarter and DHCP, click the menu System> Administration> Synaptic Package Manager (SPM). Then enter your Ubuntu root password (if requested).

2. From the window of the MSS, use the "Quick Search" to search for Firestarter package. If you've met, click the small box next to the Firestarter package and select "Mark for Installation".

3. Furthermore, in the same way, do a search for DCHP packets. If SPM presents many choices, make sure you select the package "dhcp3-server". Click the little box again and select "Mark for Installation". Then click the "Apply" with a green check mark icon at the top. The rest I'll work on Linux.

Router Configuration

4. If the installation went smoothly, the next step is to configure Firestarter for all connections from the client can be forwarded to the Internet. Run Firestarter from the menu Applications> Internet> Firestarter and enter your Ubuntu root password when prompted.

5. From the Firestarter main window, click the Preferences menu at the top (make sure the tab "Status" is active), then select Network Settings. Notice the two drop-down box that was there. Drop-down box at the top is the interface to connect to the Internet. If using an Ethernet network card, the interface is shown most likely is "eth0". While the second drop-down box shows the interface to the local network.

6. If it is determined where the Internet and local network, you can simply enable (check) the option "Enable Internet connection sharing" and "Enable DHCP for the local network" (automatic client IP allocation). Range of IP allocation using DHCP also can you set yourself, by clicking the black arrow next to the option "DCHP server details". Other options on this window can be left as is, because we do not really need it.

7. After all is finished is set, click the "Accept". By clicking the "Start Firewall", your PC has become a router to share an Internet connection. Easy, right?

TIPS: Bonus Firewall

Incomplete feel if a router is not equipped with additional security to ward off attacks that are likely to come from the Internet. Fortunately, Firestarter is designed to secure a PC connected to the Internet, including clients that are connected via Internet Connection Sharing.

Actually, by default, Firestarter has worked as a firewall since it was first activated. But the default settings in our opinion still has many holes which if not closed it is not likely going to be penetrated cracker.

If security is your priority while surfing fun, it never hurts to follow the simple steps below.

A. Facing Attacks from Outside

1. Reopen the Preferences window in Firestarter. This time select "ICMP Filtering" and enable (check) the option "Enable ICMP Filtering". Ignore the other options under it if there are no other features of the ICMP protocol which allowed acceptable PC. Next, click the Accept button.

2. Back to the Firestarter main window, then select the tab "Policy". In Editing options, make sure the chosen "Inbound traffic policy" which means we will make rules about "who can access a PC or a port from the Internet". If no port that can be accessed from the Internet, so be sure to list the "Allow connections from host", "Allow service", and "Forward service" to be empty. Conversely, if you want to allow a host of Internet-connected to the router side of this, right-click an empty area on the list "Allow connections from host" and choose "Add rule". Then enter the IP address of hosts that are allowed to access the router. If you have, do not forget to click the "Add" and "Apply". The same way can be done to allow port connection / service from the Internet, it's just that you have to work in the "Allow service".

3. If you have, try to test your PC with the help of site security audits of Gibson Research (www.grc.com). Compare the results before and after the configuration is done (see if you get the title of "Passed" on TruStealth Analysis or not).

B. Restricting Client Access URL

After successfully restrict access from the outside, now we will make restrictions on clients that will access the Internet. This is especially useful if you want to save bandwidth or to prevent underage users accessing inappropriate sites. Here's how to do it.

1. From the Firestarter main window, click the tab "Policy" and change the dropdown editing to "Outbound traffic policy". This option is used to restrict access to the Internet or a local client opposite of "Inbound traffic policy" that we discussed above.

2. Two radio buttons will appear which each contain an option "Permissive by default, traffic black list" and "Restrictive by default, whitelist traffic". Permissive by default used if you want to allow all data traffic from clients to the Internet and using a list of policy to block addresses, the host or service / specific ports. Conversely, Restrictive by default is used to block all traffic from client to Internet data and use the list policy to allow access to the address, host or service / specific ports. If you want to block a specific address, select Permissive by default.

3. To order for Firestarter block certain sites, do it by right-clicking an empty area on the list of "Deny connection to host", then choose "Add rule". Enter the IP address or domain name (without "http://") in the field "IP, host or network", then click Add. If you have, do not forget to click Apply at the top of the window of Firestarter. Try to visit the address had been blocked using the browser.
READ MORE - Building a Router at Home With Ubuntu

Tuesday, March 29, 2011

How to Upload MySQL Database with phpmyadmin

How to Upload MySQL Database with phpmyadmin












Many webmasters who started websitesnya from the local computer by using php and mysql.

The difficulty that often occurs when uploaded to the server mysql database. The following actions should be taken.

That need to be prepared on the local computer is phpmyadmin, phpmyadmin is usually already installed when you install software packages such as WAMP Server, XAMPP and PHP Triad consisting of a package of Apache, Mysql, phpmyadmin.

To export data commonly used facilities 'MySQL Dump' in phpmyadmin.

Two steps are done that is in Local Computer and the Server. If you already have a database in the form of a file just follow the steps on the server.

ALL STEPS BELOW HAS BEEN SUCCESSFULLY TESTED BY THOUSANDS OF PEOPLE, THAT ERROR OCCURRED IN YOUR ORDER TO BE BACK WebSites steps ESPECIALLY IN CONFIGURATION: DATABASE NAME, USER NAME AND DATABASE HOSTNAME

The steps on your local computer:

1. Log into phpmyadmin on your local computer
2. select the database you want to dump,
Located on the left phpmyadmin

3. Phpmyadmin will display the tables contained in the database.
4. click on the 'Export'
5. Now you are on the option that determines the 'How do you be in the dump database',

The default is SQL, and we recommend using SQL.

Sometimes you need to select 'Add DROP TABLE' point to add the SQL to delete the previous table at the time of import on the server.

Another option you can also use the 'Save as File', we recommend using the SQL option.

6. click 'go'

Results dump will be displayed in the browser, then you copy these first results.

To create a mysql database, following the steps in your hosting cpanel:

Login to the cpanel of your website in a new window:

http://www.yourdomain.com/cpanel

replace yourdomain with your domain name.

After logging into your cpanel do the steps below:

If you have not set up MySQL users and databases in cpanel. follow these steps:

1. Click on the 'MySQL database'

2. fill in your username and password on the option 'Add New User' and then click 'Create User'

Mysql user is automatically formed will be preceded and followed by a user cpanel mysql user name that you input. as an example:

usercpanel_namausermysql

3. Enter the name of the database you want to create the 'new database' and click 'Create Database'

Mysql database automatically formed will be preceded and followed by a user cpanel mysql database name that you input. as an example:

usercpanel_databasemysql

4. Add users to the database that you created by selecting 'Add User To Database' and click 'submit'

5. Select ALL PRIVILEGES and click 'Make changes'

From the above we can note two important configurations needed to connect to the database:

1. database name: usercpanel_databasemysql

2. user database: usercpanel_namausermysql

Note:
* mysql database, username and password have been formed for NOTE, because it will be necessary to connect to your database.

* MySQL Server use localhost

you should note from the article above: NAME DATABASE, USER and PASSWORD DATABASE DATABASE
Without all three you know, your website will not be able to connect to the database server.

2. After the database, and user database form, click the icon on the main page of cpanel phpmyadmin (in addition to 'MySQL database')

3. Phpmyadmin will appear, then select the database that you fill with the results of the MySQL dump, located on the left menu.

4.Click on the 'SQL'

Your stay PASTE results mysql database dump from your local computer in the 'Run SQL Query "

5. Finally click 'GO'

It's finished, all the mysql database you've uploaded to the server
Next you just adjust your PHP scripts to connect to the database by changing the configuration database, mysql user and password that has been formed.
READ MORE - How to Upload MySQL Database with phpmyadmin

In this example, we are using phpMyAdmin 2.6.1-pl3 on the local computer

MySQL has a facility called â € œMySQL Dumpâ €??. Usually used to perform backups on the database, or to transfer data to the server. The easiest way to do the dumping in your MySQL database is through phpmyadmin

Small Note: phpmyadmin is a tool that is created using PHP and used to simplify the administration of MySQL database

On the Local Computer
In this example, we are using phpMyAdmin 2.6.1-pl3 on the local computer, the steps:
a. type the path to your phpmyadmin on localhost


b. select the database you want to dump,


Located on the left phpmyadmin

c. if you already have selected a database, then phpmyadmin will display the tables contained in the database.
d. click on the â € œExportâ €?
e. Now you are at the option of determining â
€ œ How does your database will be in dumpâ €??,
Note on the menu option:
â € ¢ Export: Choice of how to dump from your database will be displayed. The default is SQL.
If you will use a dump of the database to be transferred into your website, then use SQL.

â € ¢ SQL option: opsi2 about any query that will be used to dump your database.




Opsi2 for export using SQL

â € ¢ Save as File: If you want a direct result of a database dump is saved, then check this section

in this section, you also can choose the compression type to dump your database

f. click â € ~ cave € ™


If you check the previous â € ~ save as fileâ € ™ will be out a popup window (file download).

If not, then the results will be displayed from a database dump



directly in the browser

Results dump is displayed in the browser, you should first copy

On Your Website
Login to your cpanel website (http://domainanda/cpanel) with



using the username and password have been sent by Rumahweb.
Once logged in, you can use phpmyadmin which is contained in the cpanel, step steps:
a. Click on the menu â € ~ MySQL databaseâ € ™
 â € ¢ If you have not set up MySQL users and databases in cpanel. Then follow these steps:
i. fill in your username and password for the MySQL user
Then click on â € ~ Add Userâ € ™
Note: remember baik2 username and password that you created, because it will be necessary to connect from php to your database.
ii. Enter the name of the database you want to create




lik add "user to db"

b. after you enter the menu â € ~ MySQL databaseâ € ™, click the link to the phpmyadmin



d. Then click on the menu â € ~ SQLâ € ™

e. If you:
a. No


using â € ~ Save as fileâ € ™ to the last database dump, then you can make copies (at the dump on the local computer)

Then you paste in the â € ~ Run SQL Queryâ € ™

Then click on â € ~ cave € ™

b. Using the â € ~ Save as Fileâ € ™, then you live to upload the file from a database dump earlier.

Click browse, then


click â € ~ openâ € ™

Then, you just click on the â € ~ cave € ™

So your database was completed uploads




READ MORE - In this example, we are using phpMyAdmin 2.6.1-pl3 on the local computer

How to Automatically Backup Inter 2 Server Linux

How to Automatically Backup Inter 2 Server Linux

Using Linux as an operating system has many advantages. In addition to virus-resistant, many automated functions that can be done through scripts. For example, for backup or synchronization between two file-sharing server can be done with scp command (server copy) combined with cron to automate (scheduling).

Scp command requires the function ssh (secure shell) to be connected with a remote server. So ssh can simply fill in the connect without a password, do the following:

1. Create a private / public key on the local server
ssh-keygen-t rsa

2. Copy public key to the remote server
scp ~ / .ssh / id_rsa.pub remote_host:

3. Add the key to the remote server is trusted key

Login to the remote server. If you have not ever make a key at all, run ssh-keygen-t rsa to prepare a directory for the key.

Then add a new key made earlier to the file authorized_keys
cat ~ / id_rsa.pub>> ~ / .ssh / authorized_keys

Change the file-level access to the command:
chmod 644 ~ / .ssh / authorized_keys


4. Now you try to login to a remote server via ssh
ssh username @ remote_server

If the above steps correctly, you should get in without entering a password.

5. Create a script to copy files from remote servers
scp username @ remote_server: / remote_dir / local_dir

Save command into a file (eg: mybackup.sh) and change its file mode with chmod 755 mybackup.sh

Mybackup.sh file copy to the directory / etc / cron.daily to get running automatically every day.
READ MORE - How to Automatically Backup Inter 2 Server Linux
 
THANK YOU FOR VISITING