The sample script shows you how to connect to a Microsoft SQL database. The additional database drivers are located in the file sqljdbc.jar, and the class name of the database driver is SQLServerDriver. Replace these values with values of choice to integrate to other databases.
/* * Copyright (c) 2011 Schneider Electric. * * DISCLAIMER: The sample code described herein is provided on an "as is" basis, without warranty of * any kind, to the fullest extent permitted by law. Schneider Electric does not warrant or * guarantee the individual success developers may have in implementing the sample code on their development * platforms or in using their own Web server configurations. * * Schneider Electric does not warrant, guarantee or make any representations regarding the use, * results of use, accuracy, timeliness or completeness of any data or information relating to the * sample code. Schneider Electric disclaims all warranties, express or implied, and in particular, * disclaims all warranties of merchantability, fitness for a particular purpose, and warranties related * to the code, or any service or software related thereto. * * APC by Schneider Electric shall not be liable for any direct, indirect or consequential damages or costs * of any type arising out of any action taken by you or others related to the sample code. */ /* * This script shows how to load the database driver for the MS SQL database. * * The file and class names will vary between database providers. Please consult the documentation of * the JDBC driver applicable to your database system of choice for further information. */ // Make the necessary classes available to the script importPackage(com.apc.e2m.server.scripting); // Define location of driver file driverFile = "sqljdbc.jar"; // Add the driver to the classpath ScriptClassPath.addFile(driverFile); // Load the driver class java.lang.Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
0 comments
Please sign in to leave a comment.