Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JDBC for the first time

 
Alice Hampton
Ranch Hand
Posts: 217
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been reading up on JDBC and I understand what it's to be used for and such but I still have a few questions.

1) When setting up a driver - do you need to set it up depending on what system you use for example if I used SQL or mySQL would each have their own driver?

2) Is there a free to use public db out there with data in for test purposes that could be used?


Thanks if anyone can answer!
 
K. Tsang
Bartender
Posts: 3585
16
Android Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there

For your questions
1/ Each database has it's own jdbc driver, hence its own driver class that you need to specify in code if using JDBC3. For JDBC4 this is not needed.


Different DB has its own jdbc url. For example, mysql is "jdbc:mysql://localhost:3306/myschema" and mssql "jdbc:sqlserver://localhost:1433;databasename=myschema"


2/ there are a few database products that are free: mysql community, postgresql, oracle XE, sql server express, DB2 express.
With data? I doubt. Maybe those database that comes with an app. Under such apps, usually they use derby (yet another free database).
 
Alice Hampton
Ranch Hand
Posts: 217
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there Tsang,

thank you for the reply to my questions - that was certainly helpful! I have done db work in the past I was just wondering if there was any db's kicking around out there I could of quickly hopped onto for testing just to see if they worked how I how I thought with java.

- also you've made the driver thing much more clearer now I understand that 100% so thanks!!
 
chris webster
Bartender
Posts: 2407
33
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Oracle XE comes with various demo users and sample data that are used in many of the Oracle database tutorials. Oracle XE is free and provides a lot of functionality, and it's easy to set up. I recommend the free SQL Developer tool as well, which gives you a powerful GUI based tool for playing around inside your database.
 
Dave Tolls
Ranch Hand
Posts: 2112
16
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chris webster wrote:I think Oracle XE comes with various demo users and sample data that are used in many of the Oracle database tutorials. Oracle XE is free and provides a lot of functionality, and it's easy to set up. I recommend the free SQL Developer tool as well, which gives you a powerful GUI based tool for playing around inside your database.


I seem to remember that XE doesn't come with the Scott instance for some reason.
Possibly they changed it.

Quick Google and indeed, they have. It's the HR schema now!

Here's the Oracle 10 version of the "How To" Java Dev...couldn't find the 11 one, but here's the "How To" in general one for 11.2.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic