File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes ODBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "ODBC" Watch "ODBC" New topic


henry akoma

Joined: May 17, 2005
Posts: 21
i have tried configuring my ODBC, but bcos their are so many option(user DSN, System DSN, File DSN, etc) and so many things in the ADD button, i am really confused as per which to use and each time i try any option my program gives an error.

i dont know if this is the best forum for me to ask for a step by step ODBC configuration assistance, but i will appreciate it if someone helps me out. i just want to write a simple transaction program and i have been on it for too long.

i already have used the code
but another problem i have is where to specify as my url
does the program create the data source for me or do i create it by another means .

please i need help in this area.
thanks for your cooperation
[ September 22, 2005: Message edited by: Bear Bibeault ]
Dave Salter
Ranch Hand

Joined: Jul 20, 2005
Posts: 293

You are better off creating a system dsn. That is accessible by all users and all applications on your system. Create this in the ODBCAdmin app in the control panel and call it something like "MyDSN".

Your URL to access it will then by jdbc dbc:MyDSN

You have to get a connection to the database by doing something like:

Connection connection = DriverManager.getConnection(url);
Tom Blough
Ranch Hand

Joined: Jul 31, 2003
Posts: 263

What database are you using? With that information we can give much more specific instructions.


Tom Blough<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>Cum catapultae proscriptae erunt tum soli proscripti catapultas habebunt.<hr></blockquote>
henry akoma

Joined: May 17, 2005
Posts: 21
thanks for your contribution.

i am actually new to database technology, so i dont know if i can be specific about the database i am using but i will try to paint a good scenario of what i am doing.

i have written a program using the oracle sotware(sql).i have saved it as C:\sql\coffees.sql. i now want to use java to both retrieve data and modify data in that file.

another huddle i need to cross now is to determine which driver to choose from in the ADD button of the System DSN window.

is this infomation enough, if not i am ready to answer any questions. thanks.
henry akoma

Joined: May 17, 2005
Posts: 21
hey guys, thank you so much, i have finally gotten a good run of the program.
i appreciate your contributions
I agree. Here's the link:
subject: ODBC
It's not a secret anymore!