I'd like to get a better understanding of how JDBC works.
As far as I understood, JDBC is (originally) Sun's interface for connecting dbs. Each implementation is a db driver, such as mysql or derby. JDBC URL is just a pattern, e.g. jdbc:driver://localhost:port/database_name, so it's parametrized.
If I want to connect to a database from any application without an IDE, say a small console application, I need to include a .jar with the driver and configure the connection inside the app (url, user, password, etc.). Is it all I should take care of? I mean - inside the NetBeans IDE there is 'services' tab next to 'projects' and 'files', where I add and remove jdbc connections. Are these just shortcuts to existing database so that I can access them (by clicking) faster or are they some kind of connection objects stored anywhere so that I shall create such objects in my console application?
Please correct me if I misunderstood anything. I'm a newbie, so forgive me silly questions... Thanks in advance!
Yes, your understanding is correct. You don't need to set up any connections in the IDE for your program to be able to access the database. All you need is a JDBC driver on the classpath, initialization of the driver in your startup code (prior to JDBC 4.0 driver autoload, that is), and a connection URL.