Invoking DQL Server in Java applications

Read(859) Label: dqlserver, java, jdbc connection,

Using the Java language as an example, this subsection is a quick guide to connection to DQL Server services through JDBC.

JDBC connection:

public void DQLServerJDBC() {

Connection con=null;

try {

// Establish a connection

Class.forName("com.esproc.dql.jdbc.DQLDriver");

con = DriverManager.getConnection("jdbc:esproc:dql://192.168.1.8:3366/datalogic","sa","sa");

// Create and execute DQL statement

PreparedStatement stmt = con.prepareStatement("SELECT EmpID,Name FROM Employee", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);

ResultSet set = stmt.executeQuery();

…….

} catch (SQLException e){

System.out.println(e);

}finally{

// Close data set

if (con!=null) con.close();

}  

}