• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help on setting up Datasource in WSAD 4

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, guys,
I am new to WSAD, and encounter a lot problems when setting up datasource.
My first question is: How to setup an Access DB connection in WSAD? Cause I can't find the access driver for WSAD anywhere.
Question #2: Do I have to put all the DB connection information into the DataSource tab in server-cfg.xml? I want to load the properties from a local file, can I do that?
Thanks for your help!!!
Kevin
 
Kevin Black
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't believe no one is using Access any more. Everyone got a DB2?
[ January 31, 2003: Message edited by: Kevin Javapro ]
 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kevin,
Don't know about WSAD 4.0 but in 5.0 you can go to the server window, right click and select open. There is a datasource tab that is pretty easy to work with and this should update your server-config.xml file. If you don't care about connection pooling in your test environment, you can just set up the datasource on you box and make sure the driver is in the classpath.
 
Kevin Black
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, William,
Actually, in WSAD 4.03, there is the same datasource tab you can find under server-cfg.xml.
But there is no driver available for MS-Access. I can find merantlink driver for MS-SQL Server, but not for Access.
Is WSAD not support MS-Access connection?
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nope. Think about it -- Access is a Microsoft product -- do you think that THEY are going to release an up-to-date JDBC driver for it? I'd be surprised if you found anyone using Access with WebSphere...
Kyle
 
Kevin Black
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Kyle and William,
That make sense! Good to know I am choosing the right side(.net vs java).
In the end, I found a way to get aroud with that problem, see below:
///////////////////////////////////
//change DBQ and sql statement as your
//local setting
package database;
import java.io.*;
import java.sql.*;
public class MobileDatabase {
public static void main(String[] args) {
try {
//Load JDBC driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String dbUrl =
"jdbc dbc river={Microsoft Access Driver (*.mdb)};UserCommitSync=Yes;Threads=3;SafeTransactions=0;PageTimeout=5;MaxScanRows=8;MaxBufferSize=2048;FIL=MS Access;DriverId=281;DBQ=d:\\Kevin\\WSAD\\KevinTest.mdb";
Connection con = DriverManager.getConnection(dbUrl, "", "");
Statement state =
con.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
String sql = "SELECT document_name FROM Document;";
ResultSet rs = state.executeQuery(sql);
if (rs != null) {
while (rs.next()) {
System.out.println("\t" + rs.getString("document_name"));
}
rs.close();
con.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
////////////////////////
It works, but that's not the exact what I want to do: setting up DataSource in WSAD. Guess I will use another DBMS in WSAD for using that.
Kevin
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup. Good idea (use another database, that is). BTW, you know that both Oracle and DB2 offer free single-user developer licenses from their websites...
Kyle
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic