aspose file tools*
The moose likes JDBC and the fly likes which DBMS to learn ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "which DBMS to learn ??" Watch "which DBMS to learn ??" New topic
Author

which DBMS to learn ??

abhishek kunal
Ranch Hand

Joined: Jul 27, 2009
Posts: 42
i am often confused about which dbms to use for jdbc. learning it specifically for any dbms is certainly a limitation to that particular dbms. or in layman words i don't know how to study jdbc, please suggest me some way...i believe there are dbms specific issues and methods.so how to do an independent but still comprehensive study of jdbc....
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2584
    
    9

Hello there, JDBC is indeed a bit enormous. The API is huge. However, using JDBC for each DBMS is a bit different. I'm sure say connecting to MySQL and Oracle is a bit different. Once connected, getting the data (querying) can be different too.

So the easiest to do is to say choose a DBMS like Oracle or MySQL or even SQL Server or whatever you like. Then download that database's particular JDBC and have a look at that JDBC's API (provided by the database provider). I use MySQL most of the time and the JDBC driver is ConnecterJ.

Once you get aquainted, try some code connecting to the db and query some data. Then you will be on a roll.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5 OCPBCD5
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
abhishek kunal wrote:i am often confused about which dbms to use for jdbc. learning it specifically for any dbms is certainly a limitation to that particular dbms. or in layman words i don't know how to study jdbc, please suggest me some way...i believe there are dbms specific issues and methods.so how to do an independent but still comprehensive study of jdbc....


The good thing about JDBC is, it doesn't really matter which DBMS you use.

Maybe try mySQL. The advantage of mySQL is that you can download it for free, and it is widely used by many organizations. I have mySQL installed on my personal computer, and have no problems with doing basic JDBC programming in that setup.

OK Mr Tsang and I give conflicting advice. My undersatnding is that JDBC itself, once you get the right driver for your particular DBMS, is pretty much the same for various systems, but I am certainly not an expert, so maybe Mr Tsang is right.

edit again: ok SQL syntax itself is not really part of JDBC, JDBC provides a means to deliver SQL queries from java, in that sense I agree with Mr Tsang.
Omar Al Kababji
Ranch Hand

Joined: Jan 13, 2009
Posts: 357
ok in the market the most popular to use is Oracle so learning oracle would be the best, but if you are a starter and never used SQL before I would suggest to download postgres DB it is lightweight compared to Oracle and easy to install in the same time its robust and very powerful.

So download Postgres and PGAdmin.


Omar Al Kababji - Electrical & Computer Engineer
[SCJP - 90% - Story] [SCWCD - 94% - Story] [SCBCD - 80% - Story] | My Blog
abhishek kunal
Ranch Hand

Joined: Jul 27, 2009
Posts: 42
hii, thanks to all of you for your valuable advices... by the way,i am not newbie in database applications! now i can figure out, what really i have to do... and yes there are differences(a little, i had witnessed while i was using MySql).will tell ya later....
Raghu Devatha
Ranch Hand

Joined: Feb 10, 2009
Posts: 39
I think it is good enough if you know any one of the DBMS, mySQL can be a good start, if not Oracle. But you can stop worrying about what DBMS you use( almost) when you start using frameworks such as Hibernate. JDBC is a good start.


dR
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

Fred Hamilton wrote:The good thing about JDBC is, it doesn't really matter which DBMS you use.


I wish that were true, I really do. The fact of the matter is 99% of all JDBC-based applications *CANNOT* be easily ported to a different database without at least 1 (or 10,000) query 'tweaks'. The only advice I can give you is never rely on built-in functions or syntax that seems db-dependent, you'll dig your own grave every time. On the other hand... generally object-relational mapping solutions like Hiberate/JDO are more easily ported because the developer almost never writes any queries.


My Blog: Down Home Country Coding with Scott Selikoff
Vamsi Mohan
Ranch Hand

Joined: Jun 20, 2009
Posts: 80
You can use mysql or hsqldb for the learning purpose. If you want to use independent, you can use Hibernate mapping of database.


VAMSI MOHAN.V
(SCJP5.0, IBM Rational Solution Designer, IBM Rational Architect, IBM RUP Designer)
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30894
    
158

Scott Selikoff wrote:
Fred Hamilton wrote:The good thing about JDBC is, it doesn't really matter which DBMS you use.


I wish that were true, I really do. The fact of the matter is 99% of all JDBC-based applications *CANNOT* be easily ported to a different database without at least 1 (or 10,000) query 'tweaks'.

True. However, for learning JDBC, I think the case is different. You can easily limit yourself to trying standard SQL if you aren't doing something complex.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
Scott Selikoff wrote:
Fred Hamilton wrote:The good thing about JDBC is, it doesn't really matter which DBMS you use.


I wish that were true, I really do. The fact of the matter is 99% of all JDBC-based applications *CANNOT* be easily ported to a different database without at least 1 (or 10,000) query 'tweaks'. The only advice I can give you is never rely on built-in functions or syntax that seems db-dependent, you'll dig your own grave every time. On the other hand... generally object-relational mapping solutions like Hiberate/JDO are more easily ported because the developer almost never writes any queries.


OK perhaps I spoke a little loosely. I hadn't considered porting applications between databases. IN addition to what Jeanne said, Yes, there are choices to be made when choosing a dbms, but surely the tweaks you speak of aren't java tweaks, but tweaks to SQL embedded in java. In other words, if all DBMS systems conformed to to SQL standards, there really would be no issue. agreed?
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

Fred Hamilton wrote:surely the tweaks you speak of aren't java tweaks, but tweaks to SQL embedded in java. In other words, if all DBMS systems conformed to to SQL standards, there really would be no issue. agreed?


I wish the tweaks to be in java, that's often more manageable then trying to rewrite a 5-6 (or 30) line query. As for conforming to SQL standards, that's a dream I gave up on a long time ago. I think it was around the time I learned how to make a sequence for performing an auto-increment value in Oracle, or perhaps it was when I read tens of thousands of lines of code that used functions like nvl(), getdate(), now(), etc. In short, I have yet to come across a JDBC application with more than 10 queries that can be easily ported to a different database. It really takes an object-relational mapping tool to have a portable database-based application, since most developers are just not that disciplined.

Back to the original subject, I do think the database matters to some degree when learning. What you need to keep in mind is how you do things in one system may not match how you do things in others. Syntax can change among DBMS, and some are far better then others at certain things. My general rule of thumb, though, is this:

For simple applications and learning, use MySQL; for gigantic applications with millions of transactions a day, use Oracle; if you're stuck with Microsoft, use MS SQL Server.

I have tried many others, but unless you have a specific need (like an embedded DB), those are the top 3.
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
Scott Selikoff wrote:
Fred Hamilton wrote:surely the tweaks you speak of aren't java tweaks, but tweaks to SQL embedded in java. In other words, if all DBMS systems conformed to to SQL standards, there really would be no issue. agreed?


I wish the tweaks to be in java, that's often more manageable then trying to rewrite a 5-6 (or 30) line query. As for conforming to SQL standards, that's a dream I gave up on a long time ago. I think it was around the time I learned how to make a sequence for performing an auto-increment value in Oracle, or perhaps it was when I read tens of thousands of lines of code that used functions like nvl(), getdate(), now(), etc. In short, I have yet to come across a JDBC application with more than 10 queries that can be easily ported to a different database. It really takes an object-relational mapping tool to have a portable database-based application, since most developers are just not that disciplined.

Back to the original subject, I do think the database matters to some degree when learning. What you need to keep in mind is how you do things in one system may not match how you do things in others. Syntax can change among DBMS, and some are far better then others at certain things. My general rule of thumb, though, is this:

For simple applications and learning, use MySQL; for gigantic applications with millions of transactions a day, use Oracle; if you're stuck with Microsoft, use MS SQL Server.

I have tried many others, but unless you have a specific need (like an embedded DB), those are the top 3.


ok bud, food for thought, it sounds like you've been at this a lot longer than I have. Yeah I guess I have to agree choice of DBMS matters a lot. Just for clarity sake, I guess I meant that JDBC works pretty the same way when you factor out syntactical differences in the SQL itself. but I can see there is a lot more to the decision.

I hope we can all agree that MS Access is a bad choice? It's my understanding that it is notorious for non-standard SQL, at least it used to be.

regards.
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

Fred Hamilton wrote:I hope we can all agree that MS Access is a bad choice? It's my understanding that it is notorious for non-standard SQL, at least it used to be.


No argument here. I refuse to consider MS Access database software. To me, its a glorified Excel spreedsheet.
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

All this talk, you guys have inspired me to write a blog entry about the subject: Which Database to Start With?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: which DBMS to learn ??