This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Help on setting up Datasource in WSAD 4

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
 
Do not set lab on fire. Or this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!