This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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
my ODBC user id is chaz003
its password is somthing else
the database is database1

String url = "jdbc:// odbc://;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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: I can't seem to get my ODBC url right
It's not a secret anymore!