wood burning stoves*
The moose likes JDBC and the fly likes I can't seem to get my ODBC url right Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "I can Watch "I can New topic

I can't seem to get my ODBC url right

Chaz Andrews

Joined: Sep 20, 2005
Posts: 23
I've tried every combination I can think off for my ODBC connection, but nothing seems to work. I'm trying to connect to my web service's database. They claim its not blocked, but who knows
the address is www.coconutandmango.com
my ODBC user id is chaz003
its password is somthing else
the database is database1

String url = "jdbc:// odbc://coconutandmango.com;UID=chaz003;PWD=wouldntyouliketoknow";

What am I doing wrong
[ January 04, 2006: Message edited by: Chaz Andrews ]
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333

In other words, an ODBC connection usually doesn't refer to a hostname, but rather to a DSN which knows about the host. Here's some references:

However, you can also use a DSN-less ODBC connection; in this style of connection, you must supply all sorts of ODBC information that is normally part of the DSN configuration. Here are some examples:

Third, a lot of connection issues and syntax depend on the particular driver being used and the particular database program being connected to; if the above info doesn't help, you might provide that information and post the rest of your connection code and what sorts of errors you're getting, maybe someone else will spot something wrong...

[edited to disable smilies]
[ January 04, 2006: Message edited by: Jeanne Boyarsky ]
Chaz Andrews

Joined: Sep 20, 2005
Posts: 23
wow, thanks stu, thats really helpful
I agree. Here's the link: http://aspose.com/file-tools
subject: I can't seem to get my ODBC url right