FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


connection JSP ms access





mialynavahy
hui
i want connect my database access with jsp pages; but i dont know how to proceed
my jsp pages and the file table.mdb are in the server and i will create an odbc connection, i find this code in the net but i dont know if it's right and i dont know where can i find the uid and the password pwd :
try {
String query = new String();
ResultSet rs = null;
Connection con = null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//open a connection to the database
con = DriverManager.getConnection("jdbc:odbc:acc",uid,pwd);
Statement stmt = con.createStatement();
...
}
thanks
poppitz
Hi,

I haven't used jdbc with ms access but with oracle right now and your code looks good.

The API Docu (http://java.sun.com/j2se/1.4.2/docs/api/) says:
url - a database url of the form jdbc:subprotocol:subname
user(uid) - the database user on whose behalf the connection is being made
password(pwd) - the user's password

So you should use the access username and password.[/code]
mialynavahy
poppitz wrote:
Hi,

I haven't used jdbc with ms access but with oracle right now and your code looks good.

The API Docu (http://java.sun.com/j2se/1.4.2/docs/api/) says:
url - a database url of the form jdbc:subprotocol:subname
user(uid) - the database user on whose behalf the connection is being made
password(pwd) - the user's password

So you should use the access username and password.[/code]


hi
thanks, i used it with access and oracle and it works but the problem with access is that i cant share the database, only on my computer Sad
Related topics
SQL Basics
Programming links, info, and tutorials
To Moderators: Should C++ questions be in "scripting&am
Question about SQL
ms access
Database for Dentists
Access Internet On Your Phone Using Pc Internet., Free No Gp
what is dump?
Converting Access database to SQL server 2005
ms access and visual basic
MS Access - tutorials
MS Access 2007 compatibility with MS Access 2003/XP
How about servlets or jsp?
Can't access my blog
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.