• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Using JDBC for the first time

 
Ranch Hand
Posts: 217
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 4801
50
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic