Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Simple & easy BUT urgent (http://www.velocityreviews.com/forums/t954586-simple-and-easy-but-urgent.html)

Oussama Romdhane 11-17-2012 11:02 PM

Simple & easy BUT urgent
 
hi everyone, I'm new here so hey there all !
I just want you guys to give me the necessary line codes to connect an access data base (.mdb) to a java program (I'm working on web services using the soap exchange method)
Thanks a lot
OR

Jeff Higgins 11-18-2012 02:48 AM

Re: Simple & easy BUT urgent
 
On 11/17/2012 06:02 PM, Oussama Romdhane wrote:
> hi everyone, I'm new here so hey there all !
> I just want you guys to give me the necessary line codes to connect an access data base (.mdb) to a java program (I'm working on web services using the soap exchange method)
> Thanks a lot
> OR

import java.sql.*;
class Scratch
{
public static void main(String[] args) {
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection c = DriverManager.getConnection("yourdatabaseurl");
} catch (Exception e) {}
}
}

Arne Vajh°j 11-18-2012 03:11 AM

Re: Simple & easy BUT urgent
 
On 11/17/2012 6:02 PM, Oussama Romdhane wrote:
> hi everyone, I'm new here so hey there all ! I just want you guys to
> give me the necessary line codes to connect an access data base
> (.mdb) to a java program (I'm working on web services using the soap
> exchange method)


With DSN:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:Test");

DSN less:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =
DriverManager.getConnection("jdbc:odbc:;Driver={Mi crosoft Access Driver
(*.mdb)};Dbq=C:\\Databases\\Test.mdb;");

But now the important part: The JDBC ODBC bridge is known to
have problems - especially with concurrent usage. Web services
will typical be concurrent usage. I will strongly recommend
a different solution - maybe a different database.

Arne


All times are GMT. The time now is 07:39 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.