File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
I agree. Here's the link:
subject: DSN problem
It's not a secret anymore!