简体   繁体   中英

The topics that should be covered for learning JDBC

I have been asked to learn JDBC. I do not know where to start. I have started with some books. It's using some SQL tables (I am also new to SQL). So I want any of you to assist me that the topics that should be covered for JDBC. I also want to know how to creae a simple DB in Windows, so that database will be connected to my program.

Which books, materials are useful to know for:

  • Java Beginners
  • JDBC
  • Connection between Java & JDBC (I do not know whether its right or not)
  • Relation between Java & SQL.

Start by focusing on accessing a Database using SQL.

JDBC just lets your write Java code to call the SQL, so you need to understand SQL first, and to understand SQL you need to understand Databases a little: Tables, Columns, Keys.

So you could work through a tutorial such as this link text .

Java Beginners

Head to Sun Oracle's own tutorials.


JDBC

Again, the vendor's own tutorials are the best (only learn it after basic Java!):

You'd like to learn SQL first beforehand (learn it before JDBC):


Connection between Java & JDBC (I do not know whether its right or not)

JDBC is a Java API (a set of interfaces and classes). There is no such thing as "connect between Java and JDBC". You rather want to connect between Java and the database. You use JDBC for this. You first need to know the JDBC URL of the database in question and the login username and password. Then you can connect it like follows:

Connection connection = DriverManager.getConnection(url, username, password);

How the URL should look like depends on the DB and JDBC driver in question. You'd like to consult the documentation of the JDBC driver in question.


Relation between Java & SQL.

Nothing. Both are separate and independent languages each with an own purpose. SQL is a database communication language. Java is an object oriented programming language. In Java, you can use the JDBC API to execute SQL programmatically, but that's also really all.


I also want to know how to creae a simple DB in Windows, so that database will be connected to my program

Just choose a database server and download and install it. There are several popular choices:

Each of them also ships with DB vendor specific JDBC documentation. It's also worth to get yourself through it (only if you already understand basic JDBC!).


See also:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM