Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Go
New
Search
Notify
Tools
Reply
  
JDBC Code
 Login/Join
 
Member
posted
I am trying to access EDA server throught the Jlink /JDBC library. I keep getting empty record sets. is there any exmples on how to do this?
 
Posts: 12 | Registered: August 21, 2007Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Simple example:

Make sure jlink.jar is on the classpath.

package ibiexample;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class IBIJdbcCall {
	
	public static void main(String args[]) { 
		Connection conn = null;
		PreparedStatement ps = null;
		ResultSet rs = null;
		
		try {
			Class.forName("ibi.jlink.EdaDriver");
			conn = DriverManager.getConnection("jdbc:eda://localhost:8116;server=EDASERVE", "userid", "password");
			ps = conn.prepareStatement("SELECT * FROM CAR WHERE COUNTRY = ?");
			ps.setString(1, args[0]);
			rs = ps.executeQuery();
			
			// If there are rows
			if (rs != null) {
				while ( rs.next() ) {
					for ( int i = 1 ; i <= rs.getMetaData().getColumnCount(); i++ ) {
						System.out.print(rs.getObject(i).toString() + "\t");
					}
					System.out.println(" ");
				}
			}
		} catch (SQLException eSQL) {
			System.out.println("General SQL Exception: " + eSQL);
		} catch (Exception e) {
			System.out.println("General Exception: " + e);
		} finally {
			try {
				ps.close();
				rs.close();
				conn.close();
			} catch (SQLException eSQL) {
				System.out.println("General SQL Exception While closing connections: " + eSQL);
			}
		}
	}
	
}


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
 
Posts: 1090 | Location: Toronto, Ontario | Registered: May 26, 2004Reply With QuoteReport This Post
Member
posted Hide Post
where could i download the jlink.jar?
could you send it to me please?
thanks a lot.


webfocus 7.65
windows xp sp3
excel,html ,pdf,and graph
 
Posts: 20 | Registered: January 26, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 


Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.