• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I access database files with out DSN?

 
jiayu gao
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to access database file,for example MS ACCESS(.mdb).But the file was supply by the user.Maybe he/she didn't register the DSN for it.How can I implement it?
Thanks.
[ July 19, 2003: Message edited by: jiayu gao ]
 
Andri G
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as far as I know, you can't.
The DSN alias is for an ODBC alias, that when you're using JDBC-ODBC bridge it will refer to the alias.
 
Arnold Kesselaar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Guys,
I have a somewhat simmilar problem. I want to write a program that has its own little database that it can access when it wishes. I do not know the operating system of the user. The user shouldn't have to register drivers or anything. How can I do this?
 
jiayu gao
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
Does anybody know <crystal report>?
It can open so many kinds of database files with out DSN.How does it implement?
And I don't have to use JDBC/JDBC-ODBC.
Is there any other mothed?
[ July 21, 2003: Message edited by: jiayu gao ]
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Arnold Kesselaar:
HI Guys,
I have a somewhat simmilar problem. I want to write a program that has its own little database that it can access when it wishes. I do not know the operating system of the user. The user shouldn't have to register drivers or anything. How can I do this?

Try HSQLDB
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jiayu gao:
I want to access database file,for example MS ACCESS(.mdb).But the file was supply by the user.Maybe he/she didn't register the DSN for it.How can I implement it?
Thanks.
[ July 19, 2003: Message edited by: jiayu gao ]

A way around!..
if you know where the user will be storing the MDB files then you can try the below(no dsn needed)

but you have to be very careful on setting the filename as it may lean to file not foind exception
 
jiayu gao
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much,Balaji Loganathan.
I have put the database file "world20.mdb" and the .java file in the same directory.
And finally,I got the String database:
jdbc.odbc.driver={Microsoft Access Driver (*.mdb)};DBQ=world20.mdb;DriverID=22;READONLY=true}
Is it right?
But it said that "SQL Error: java.sql.SQLException: No suitable driver 0 08001".
Is there anything that I should pay attention?
And are there some documents for this technology?I want to know the details.
Thanks a lot.
[ July 21, 2003: Message edited by: jiayu gao ]
 
Marcus Howarth
Ranch Hand
Posts: 38
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

And finally,I got the String database:
jdbc.odbc.driver={Microsoft Access Driver (*.mdb)};DBQ=world20.mdb;DriverID=22;READONLY=true}
Is it right?

those smilies are getting in the way I think
try:
jdbcdbc:driver
in the database String (with colons)
 
jiayu gao
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh,what a fool fault!
I've got it. Thanks,Marcus Howarth.
And how about other kinds of database file?
Are they similar?
OR is this a property of MS Access?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic