This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes DSN problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "DSN problem" Watch "DSN problem" New topic

DSN problem

Michael Crutcher
Ranch Hand

Joined: Feb 18, 2002
Posts: 48
I feel like I'm flooding the board with my problems, but I'm new at this and I keep running into weird stuff (wierd at least to me). I have a java bean that is accessing a teradata database. The get methods open up a connection, perform a select statement, format the result set, and return a string representing a list box. The problem is that the connection never happens. The bean's get method never returns and hangs at this line:
Connection con = DriverManager.getConnection(url, username, password);
Where url is jdbc dbc ataSourceName, username and password should be obvious. The data source is a system dsn. The wierd part is that a tester program calling the exact same get method works just fine, returning a correctly formated list box string. Originally the data source was a user dsn. Thinking this might be the problem I changed it to a system dsn. Could this have anything to do with it? Could it be something within Teradata (I doubt this very seriously since it's just an odbc connection).
Any help would be greatly appreciated. I'm pretty much dead in the water at work until I figure out why I can't connect to the database through the bean.
Michael Crutcher
Texas A&M University
Jesse Beaumont
Ranch Hand

Joined: May 30, 2002
Posts: 43
You might be better on the JDBC forum with this one, but a little more information on what jdbc driver (you also mention odbc...does that mean you are using the jdbc-odbc bridge?) and other parameters, such as are the two calls (tester and bean) calling from the same machine with the same user credentials would be useful?

---<br />Time flies like an arrow,<br />Fruit flies like a banana
Michael Crutcher
Ranch Hand

Joined: Feb 18, 2002
Posts: 48
it is a jdbc odbc bridge. I tried to put colons between them and it got eaten by the smileys. Here's the get method in the bean:

Here's the bean call:

Here's the call from a tester program:

The tester program works fine, the bean call fails. It always locks at the commented line. It doesn't throw an exception or return from the method. It just locks.
Michael Crutcher
wood burning stoves
subject: DSN problem
Similar Threads
Teradata Datasource configuration on WAS V5
Connecting to MSSQL2000
establishing connection to mssql2000
Connection through bean error
Error trying to connect MS Acess 12 database