Accessing variables and methods across threads
<p>I am using java to create an interface to connect to a database. Each time I want to make a call to the database I need to create new connections to the database, which would make calling the database say 10 times slow.</p>

<p>To avoid having to create new connections each time I want to call the database I have a java thread running that holds all of the connection information. </p>

<p>To write/read from the database I want to create a thread that uses the connection information stored in the thread that's already running, use it to execute specified read/write functions, and then exit.</p>

<p>However I am having trouble accessing this information from the thread which is already running. What would be the best way to accomplish this?</p>
