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.


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

Results 1 to 2 of 2

Thread: Threads and JDBC

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Glendora, CA
    Thanked 0 Times in 0 Posts

    Default Threads and JDBC

    I'm having an issue trying to use a class I have setup to connect/query a DB from a Runnable class. If I call the DB query methods from "main" all works as expected. If I try to access it from a thread, NetBeans says I'm using incompatible types for the Driver (I don't seem to get this from a non-Runnable class.) I'm wondering if the DB query class has implement Runnable (or some other thread interface or abstract class) too.

    Basically, I want my app to run as a daemon. I need it to loop, rereading the configuration DB table for any updates at a set interval. Then, start other thread(s) to do the actual work (these sub-threads will also need to access the DB.)

    I've been playing around w/Java programming for a while, but I fit into the novice category at this point.

  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Thanked 833 Times in 772 Posts
    Blog Entries

    Default Re: Threads and JDBC

    Can you post the code where the exceptions occur (or better yet a stripped down version that reproduces the problem on your end)?

Similar Threads

  1. How Can I run java threads
    By Saeid in forum Threads
    Replies: 12
    Last Post: August 6th, 2010, 02:12 PM
  2. Working with threads
    By tccool in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 12th, 2010, 10:21 AM
  3. threads in gui
    By urosz in forum AWT / Java Swing
    Replies: 1
    Last Post: November 3rd, 2009, 05:20 PM
  4. [SOLVED] Fixing of bug for a small program
    By Koren3 in forum Threads
    Replies: 3
    Last Post: April 21st, 2009, 06:28 AM

Tags for this Thread