For school project I had to make program in Java that uses data base and to do so I had to import to that project file ojdbc6.jar. I know that without it I couldn't use data bases but I don't really know what is this file. Could someone explain? How such file is called and what exactly is its purpose?
Simply stated, a JDBC driver is a suite of classes that map the functionality required by the JDBC API onto the functionality provided by a specific kind of database.
Each database uses a different "wire protocol" to communicate between code running in a database client and the database server. JDBC "abstracts that away" so that a Java program can talk to any vendor's database (more or less1). The JDBC driver is the "glue" that makes the abstraction work.
In the Oracle case, there are multiple JDBC drivers, for various purposes including
The "ojdbc6.jar" file constitutes the Oracle thin client-side JDBC driver which is compatible with Java 6 (JDBC level 4.0).
For more information, read the Oracle JDBC FAQ.
1 - There are a couple of issues that make cross-database compatibility difficulty. Firstly, different databases support different dialects of SQL and provide different sets of SQL data types. Secondly, certain database vendors (including Oracle, before they bought Sun) have implemented non-standard extensions to JDBC.