Oracle a management data base relational model, one of the most powerful at present, developed by Oracle Corporation. Like many other systems and database managers can interact with external applications and programming languages \u200b\u200bsuch as Java, to create web sites and applications more suited to our needs.
Monday, November 8, 2010
Newly Born Baby Wish Sms
Java Connection - Oracle XE
Oracle a management data base relational model, one of the most powerful at present, developed by Oracle Corporation. Like many other systems and database managers can interact with external applications and programming languages \u200b\u200bsuch as Java, to create web sites and applications more suited to our needs.
Oracle a management data base relational model, one of the most powerful at present, developed by Oracle Corporation. Like many other systems and database managers can interact with external applications and programming languages \u200b\u200bsuch as Java, to create web sites and applications more suited to our needs.
order to make a connection between Oracle and Java need to use the Oracle JDBC driver, available in the downloads section Oracle. According to the documentation regarding this driver will mention the following:
JDBC Driver (English Java Database Connectivity ) is a protocol for access to database allows you to execute SQL statements and queries on a database. Oracle Corporation provides support for client-server application development through the use of Thin JDBC, the Oracle Call Interface (OCI) and oracle.sql and oracle.jdbc packages. These packages contain classes and interfaces that extend the standard JDBC to manipulate Oracle data types. Using them allows greater performance and flexibility in a Java application.
Oracle Java Thin is a driver for creating Java applications and applets that access to information in an Oracle database. Java Thin driver is especially designed for Web-based applications because it can automatically download from the website automatically, as an applet more. This driver will use the connection for our example. We must ensure, once you've downloaded the JAR file, store it in our class libraries (Classpath) for the Java virtual machine can make use of it. The label blog Installation discusses how to make these settings when installing the JVM.
The code of connection to the database is as follows:
The
application works in console mode, propagate the exceptions that can generate the code execution to be trapped at the highest level of the JVM.
Line 9 of the code shows the communication protocol that we established from the Java application with Oracle Database XE, where the parts that make up this line are:
String url = "jdbc: oracle: thin: @ 127.0.0.1:1521: xe";
jdbc: oracle : refers to the communication protocol.
thin : controller is used for communication.
127.0.0.1 : is the computer (server) where it is hosted database. This address can change if you are working remotely.
1521: is the port from which we obtain data handler Oracle Database XE assigned during installation.
x : is the name of the default database to Oracle XE.
itself to working with Oracle from Java is very similar to using other database managers. You only need to consider the specifications for each of them.
Subscribe to:
Comments (Atom)