Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invoking ODBC database source administrator component of windows

 
Fawad Ali
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am very much new to Swing. I have mainly worked in J2EE. But the first task which I am assigned in Swing is that I need to invoke an ODBC database source administrator component of windows from a swing button. So can anyone help me in this regard. Or if you may suggest me with a tutorial or something, that will be great. I have attached a screenshot which shows the windows component.

Thanks in advance.
ODBC.PNG
[Thumbnail for ODBC.PNG]
 
Rob Camick
Ranch Hand
Posts: 2673
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to go to the "System DSN" tab to create your data source.

The following then shows the two ways to access the database using the Access driver. You can access the database directly or through the ODBC name:



The code formatting doesn't like the following code, but here is how you can map the database directly without using ODBC:

// String url =
// "jdbcdbcriver={Microsoft Access Driver (*.mdb)};DBQ=c:/teenergy/data/teenergy.mdb";

I don't know how to turn of the Emoticons. See below for actual code.


 
Darryl Burke
Bartender
Posts: 5149
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how to turn of the Emoticons

There's a checkbox for "Disable smilies in this message"
|
|
|
|
|
V
 
Rob Camick
Ranch Hand
Posts: 2673
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a checkbox for "Disable smilies in this message"


Thanks.

For some reason this doesn't work when I edit my original posting. Maybe this property can't be edited?

Anyway here is the code I intended to post.



 
Rob Spoor
Sheriff
Pie
Posts: 20751
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll move this to our JDBC forum as I see no GUI programming in there.

The given JDBC driver works but I've heard it has some flaws. There are other ODBC JDBC drivers available, both commercial and non-commercial. So if you run into problems with this one you can easily switch to another - all you need to do is load another driver, possibly change the connection string, and the rest can stay the same.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic