Connection JDBC -> Navision

Can somebody send me the Source-Code from a JAVA-programm that connect a Navision Database with JDBC and C/ODBC? Thanks Mathes mailto:mathes99@gmx.de

What is the (intended) purpose of the JAVA program? Reading? Writing? Both? Connection through webpages on inter/intranet? Then use a JDBC-ODBC Bridge program (see www.easysoft.com for free demo). With a decent programming environment (i.e. JBuilder), you have the tools for building the straight connection, in the form of Data Controls. These are fairly simple to configure to make the connection, then it depends on what you want to do with the data how complicated it gets. But, down to the bare bones, it are SQL statements/queries that perform the action. John

I only try to program a simple read-connection like “SELECT * FROM Customer”. I tried it with ACCESS and it works succesfull, but not with NAVISION. I always get this error: java.sql.SQLException:[Navision Software a/s][Navision Financials ODBC Driver] ISAM error S0000 4 I´m using the C/ODBC 2.50 Driver and the JDK 1.3 Some tips? Mathes Edited by - Mathes on 11/30/00 2:57:11 PM

Which URL do you use to connect to c/odbc. When I try to connect using jdbc-odbc brige, i get this error : DriverManager.getConnection(“jdbc:odbc:navision”) registerDriver: driver[className=org.gjt.mm.mysql.Driver,org.gjt.mm.mysql.Driver@174b07] skipping: driver[className=org.gjt.mm.mysql.Driver,org.gjt.mm.mysql.Driver@743399] trying driver[className=sun.jdbc.odbc.JdbcOdbcDriver,sun.jdbc.odbc.JdbcOdbcDriver@b66cc] skipping: driver[className=org.gjt.mm.mysql.Driver,org.gjt.mm.mysql.Driver@a0d5d] skipping: driver[className=org.gjt.mm.mysql.Driver,org.gjt.mm.mysql.Driver@5d56d5] skipping: driver[className=org.gjt.mm.mysql.Driver,org.gjt.mm.mysql.Driver@2bab88] skipping: driver[className=org.gjt.mm.mysql.Driver,org.gjt.mm.mysql.Driver@386000] trying driver[className=org.gjt.mm.mysql.Driver,org.gjt.mm.mysql.Driver@174b07] getConnection: no suitable driver Navision server and c/odbc are well installed. Thanks,

You did configure a (System) DSN through the ODBC setup utility in the Control Panel, didn’t you? That DSN is what your bridge should be using to make the connection. As said, we have good experiences with the JDBC-ODBC Bridge from EasySoft, which we access by a couple of Java Beans through JSP pages. John

Hi John, can you send me a part of your JSP-Code please? I need the part with the connection to the Financials.-Database and the SQL-Querry. If it is possible, please send me the code to mathes99@gmx.de. Thanks Mathes

As said, we are using the JDBC-ODBC Bridge software from EasySoft UK. It’s not for free, but gives a good performance and lots of attractive features. Get yourself a free demo from www.easysoft.com The way we use to make a connection is through a JAVA class is as follws (hope the indenting survives the copy/paste): import java.sql.*; /** Connection object class */ public class WebShopConnection { private static Connection commonDataSource; public static Connection getDataSource() throws SQLException { if (commonDataSource == null) { try { java.util.Properties info = new java.util.Properties(); // Add “user” key/value pair info.put(“user”,“webshop”); // Add “password” key/value pair info.put(“password”,“webshop”); try { Class.forName(“easysoft.sql.jobDriver”).newInstance(); } catch(Exception ex) { ex.printStackTrace(); return null; } // Now establish connection with via the Driver manager String url = “jdbc:easysoft://128.1.1.1:8831/NAVC:user=UserID:password=password”; commonDataSource = DriverManager.getConnection(url, info); } catch (SQLException e) { e.printStackTrace(); throw e; } } return commonDataSource; } On the Easysoft page you can find a sample applet to make a connection also. John }