Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I access the MAS db via Java? 1

Status
Not open for further replies.

pattyc

Programmer
Aug 15, 2006
16
0
0
US
I'm running the MAS 200 4.10.1.1 client. I want to write a Java app to query the MAS database directly via ODBC (I don't want to use VI or MS Query to write to an Excel spreadsheet, for instance). How do I do this?
 
I got the query working, but it's taking 5-10 minutes! Is there any way to speed things up?

Connection conn = null;
try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(java.lang.ClassNotFoundException e) {
System.err.println("Didn't find the class"); System.err.println("ClassNotFoundException: );
System.err.println(e.getMessage());
}
try {
conn = DriverManager.getConnection("jdbc:eek:dbc:SOTAMAS90_ABC");
ResultSet results = null;
try {
...
Statement st = conn.createStatement();
results = st.executeQuery("SELECT * FROM AP_13InvHistoryDetail");
.....
 
Actually it seems to be the connection that's really taking the time.
 
Patty,

I am also experiencing long connection times.
Did you ever get this resolved?
 
Actually I ended up not connecting to the db.

DB connection and access will be slow. A possible solution is to have a secondary, faster db, but then you'll have to deal with the issue of keeping that second db in sync with the first. You could use the secondary db to just hold the more highly accessed data.
 
I don't want to use VI or MS Query to write to an Excel spreadsheet, for instance"

Using Vi to export data is not a good idea. Extremly slow. However MS Query pulling data into Excel is fast and easy and is widely used. Pulling into Access with SQL Specific Pass Through Queries is another fast and simple method.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top