File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Databases » JDBC
Bookmark "I can Watch "I can New topic
Author

I can't seem to get my ODBC url right

Chaz Andrews
Greenhorn

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:
http://www.sourcecodesworld.com/howto/java/java-0107.asp
http://www.onjava.com/pub/a/onjava/synd/2001/08/21/jdbc.html

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:
http://www.sourcecodesworld.com/howto/java/java-0345.asp

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
Greenhorn

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