由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - jdbc/odbc MS Access file creation question
相关主题
jdbc问题一问Re: Help! JDBC-ODBC in servlet. Thanks.
请教一个关于JDBC的问题,实在太烦了!Re: Interesting thing about JDBC-ODBC! Help please.
[转载] Question 1: refresh view of database?Problem solved by Re: Desperately need help on DB2 connection through jdbc in jsp page
a question regarding JDBC driver?请问个从windows通过jdbc连server的问题
jdbc with access 2000 problemJDBC怎样连接FoxPro数据库?
Re: JDBC access Oracle?? & Connection Pooling考SCEA归来
jdbc连接数据库出现的问题JDBC的问题 getTableName()
Re: JDBC, Java vs. Javascript问一个数据库字符编码的问题
相关话题的讨论汇总
话题: odbc话题: access话题: database话题: jdbc话题: ms
进入Java版参与讨论
1 (共1页)
c*****t
发帖数: 1879
1
Is it possible to create a database file through jdbc/odbc?
In the ODBC data source window, I see
MS Access Database
but, what is the url for creating database? I know that I
could create an empty access database before hand, and put
that file into the User Sources, but that's requires user
configuration, which is bad.
Anyone can help?
BTW, when I get an SQL exception such as
SQLException: [Microsoft][ODBC Microsoft Access Driver] Table 'COFFEES'
already exists.
Is the connection still
z****g
发帖数: 2497
2
I don't think you could create mdb file from JDBCODBC.
The user has to do this.
If you want to avoid user configuration, use Installshield to create
a install package. Install shiedl could do the data source setup.
And the exception seems caused from you were trying to
crate table "Coffees" which is already existing in the database.

【在 c*****t 的大作中提到】
: Is it possible to create a database file through jdbc/odbc?
: In the ODBC data source window, I see
: MS Access Database
: but, what is the url for creating database? I know that I
: could create an empty access database before hand, and put
: that file into the User Sources, but that's requires user
: configuration, which is bad.
: Anyone can help?
: BTW, when I get an SQL exception such as
: SQLException: [Microsoft][ODBC Microsoft Access Driver] Table 'COFFEES'

c*****t
发帖数: 1879
3
Thanks. I found another way. Create an empty database file and
copy it to the file name I wanted.
The exception was related to the question "should I close the connection"
part.

【在 z****g 的大作中提到】
: I don't think you could create mdb file from JDBCODBC.
: The user has to do this.
: If you want to avoid user configuration, use Installshield to create
: a install package. Install shiedl could do the data source setup.
: And the exception seems caused from you were trying to
: crate table "Coffees" which is already existing in the database.

z****g
发帖数: 2497
4
Oh, didn't read all through.
Generally, you will do is
Connection conn = null or initialize here.
try{
//sql code...
}
catch(SQLException e)
{
}
finally
{
try{
if(conn!=null)
conn.close();
}
catch(SQLException ee)
{
}
}

【在 c*****t 的大作中提到】
: Thanks. I found another way. Create an empty database file and
: copy it to the file name I wanted.
: The exception was related to the question "should I close the connection"
: part.

l******r
发帖数: 99
5
the whole steps:
1. make sure you create some good mdb files somewhere your user account have
permission to read and/or write.
2. make data source name, choose MS Access Driver ==> go to User DSN (only for
local usage) or System DSN (for mapped drives and web server usage) to create
your DSN. supposed the name is "example".
3. then your dsn is "jdbc:odbc:example"
4. use JDBC API, load jdbc driver first, then connnect to DB use
"jdbc:odbc:example", after that you can execute your SQL statements.
1 (共1页)
进入Java版参与讨论
相关主题
问一个数据库字符编码的问题jdbc with access 2000 problem
Re: can Applet use JDBC?Re: JDBC access Oracle?? & Connection Pooling
如何用java在DB2里创建一个新的databasejdbc连接数据库出现的问题
[转载] JSP access database的问题Re: JDBC, Java vs. Javascript
jdbc问题一问Re: Help! JDBC-ODBC in servlet. Thanks.
请教一个关于JDBC的问题,实在太烦了!Re: Interesting thing about JDBC-ODBC! Help please.
[转载] Question 1: refresh view of database?Problem solved by Re: Desperately need help on DB2 connection through jdbc in jsp page
a question regarding JDBC driver?请问个从windows通过jdbc连server的问题
相关话题的讨论汇总
话题: odbc话题: access话题: database话题: jdbc话题: ms