FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a 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
Reply to topic    Frihost Forum Index -> Scripting -> Others

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