Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Setting up, using DataSources

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    14
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Setting up, using DataSources

    Hello,

    I am new to the forum, and while I have some general programming experience and education, I'm pretty green when it comes to Java technologies. Currently, I'm looking for some help understanding how to use DataSources.

    Here is some background on what I want to accomplish. I am writing a Desktop application that does financial modeling. The model will read in individual records from a database table and process each one. I would like to avoid hard coding my application for any specific database(s).

    I have some experience working on a similar application written in C that utilized ODBC. That setup worked great. An administrator would set up ODBC data sources (there was an ODBC Administrator application to assist with this, the data sources were stored in a file, odbc.ini) and my application would query the ODBC system for the available data sources. The application user would be presented with a list of data sources, select one, then be presented with a list of available tables, select one, and be on with the show. To make a new data source available to the application, the system administrator just needed to configure it, and like magic, it would be available to the application user.

    So, now that I am looking to develop a new application with Java, I turned to JDBC hoping to get similar functionality. I have read through the JDBC trail, but perhaps I missed something. I found the examples to generally use the DriverManager, although the trail later mentioned that using a DataSource was preferred to the DriverManager. The trail then went on to say that DataSources could be stored and accessed with JNDI. So, I guess my questions are as follows:

    1.) There is no desktop standard for configuring data sources, analogous to the odbc.ini file that ODBC used? I infer this from the reference to using JNDI.

    2.) Is storing Data Sources in a naming service the best solution? I feel like I am placing extra requirements on my application users and their system administrators. In order to get the functionality I desire, the administrators are going to need to set up a naming service, and then get Data Sources in there. The application users are going to need to point the application to the naming service, and then specify where in the naming service to find the Data Source objects, which is all I really wanted in the first place.

    3.) How do the Data Source objects get setup / configured / instantiated?

    Thank you for your comments in advance,

    Jason


  2. #2
    Junior Member
    Join Date
    Mar 2010
    Posts
    14
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Setting up, using DataSources

    Maybe I should take a step back. Have you worked on applications that implement data access through DataSources rather than directly using the DriverManager?

    How does the application retrieve the DataSources? What configuration is required of the application users? What set up is required of their system administrators?

    Thanks

Similar Threads

  1. Setting markers in strings??
    By wingchunjohn in forum Java Theory & Questions
    Replies: 3
    Last Post: February 20th, 2010, 03:29 AM
  2. setting the compiler for eclipse mac os x
    By etidd in forum Java IDEs
    Replies: 2
    Last Post: January 29th, 2010, 10:18 AM
  3. Setting up the Floor for 2d JAva Game?
    By DarrenReeder in forum Java Theory & Questions
    Replies: 1
    Last Post: January 19th, 2010, 06:36 AM
  4. setting location of a dialog relative to the parent
    By dewboy3d in forum AWT / Java Swing
    Replies: 1
    Last Post: August 1st, 2009, 06:42 PM
  5. Problems in setting classpath
    By missyati in forum Java Theory & Questions
    Replies: 3
    Last Post: June 30th, 2009, 01:43 AM