Jump to: navigation, search

Difference between revisions of "DTP FAQ"

Line 1: Line 1:
 
{{Back To|name=DTP Main Page|href=Data Tools Platform Project}}  
 
{{Back To|name=DTP Main Page|href=Data Tools Platform Project}}  
  
= DTP Frequently Asked Questions (FAQ) =
+
This page should be a repository for all those "Frequently Asked Questions" or FAQs posted on the DTP newsgroups, mailing lists, and whatnot.
  
 
== Connectivity ==
 
== Connectivity ==

Revision as of 12:45, 1 October 2009

Back to DTP Main Page


This page should be a repository for all those "Frequently Asked Questions" or FAQs posted on the DTP newsgroups, mailing lists, and whatnot.

Connectivity

Q: How do I programmatically access an existing connection profile?

A: This is pretty simple:

  IConnectionProfile profile = ProfileManager.getInstance().getProfileByName("myprofile");

Q: How do I connect to an existing connection profile programmatically?

A: Again, pretty simple:

  IConnectionProfile profile = ProfileManager.getInstance().getProfileByName("myprofile");
  IStatus status = profile.connect();
  if (status.equals(IStatus.OK)) {
     // success
  } else {
     // failure :(
     if (status.getException() != null) {
        status.getException().printStackTrace();
     }
  } 

Q: How do I get the raw JDBC Connection from my connected connection profile?

  public java.sql.Connection getJavaConnectionForProfile (IConnectionProfile profile) {
     IConnection connection = ProfileConnectionManager.getProfileConnectionManagerInstance().getConnection(profile,"java.sql.Connection");
     if (connection != null) {
        return (java.sql.Connection) connection.getRawConnection();
     }
     return null;
  }