We will write a simple JDBC program to get started with JDBC concepts we learned at javajee.com/introduction-to-jdbc. Refer to the notes on particular database for installation and configuration prerequesites.
where username is the new username and password is the password for the new user.
NOTE: CREATE SESSION allows user to connect to the database and other two permissions are needed to create a table. Granting UNLIMITED_TABLESPACE or RESOURCE to a user enables him to create tables of ANY size on ANY tablespace( including SYSTEM) and hence is undesirable. Allocating quota on specific tablespaces is the more appropriate way to control quota allocation.
Create table employee(empName varchar(20), id int PRIMARY KEY)
insert into employee values (‘name1’,1)
insert into employee values (‘name2’,2)
Download and add the correct jdbc driver jars (ojdbc6.jar) into eclipse class path using ‘Add External Jars’ under ‘Configure Java Build Path’.
You can search for Oracle Database 11g Release 2 JDBC Drivers in google. The current download link is: http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-11201...