Examples of IInteger


Examples of org.eclipse.imp.pdb.facts.IInteger

  }
 
  public IConstructor createConnection(IString connectString) {
    try {
      Connection conn = DriverManager.getConnection(connectString.getValue());
      IInteger newKey = vf.integer(++connectionCounter);
      connectionMap.put(newKey, conn);
      return vf.constructor(JDBC.jdbcConnection, newKey);
    } catch (SQLException sqle) {
      throw RuntimeExceptionFactory.illegalArgument(connectString, null, null, addMessage("Could not connect with given connect string", sqle));
    }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IInteger

    }
  }
 
  public void closeConnection(IConstructor connection) {
    try {
      IInteger connectionId = (IInteger) connection.get(0);
      if (connectionMap.containsKey(connectionId)) {
        Connection conn = connectionMap.get(connectionId);
        conn.close();
        connectionMap.remove(connectionId);
      } else {
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IInteger

    }
  }

  public IList getTableTypes(IConstructor connection) {
    try {
      IInteger connectionId = (IInteger) connection.get(0);
      if (connectionMap.containsKey(connectionId)) {
        Connection conn = connectionMap.get(connectionId);
        DatabaseMetaData dmd = conn.getMetaData();
        ResultSet rs = dmd.getTableTypes();
        IListWriter resultWriter = this.vf.listWriter(TF.stringType());
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IInteger

    }
  }

  public ISet getTableNames(IConstructor connection) {
    try {
      IInteger connectionId = (IInteger) connection.get(0);
      if (connectionMap.containsKey(connectionId)) {
        Connection conn = connectionMap.get(connectionId);
        DatabaseMetaData dmd = conn.getMetaData();
        ResultSet rs = dmd.getTables(null, null, null, new String[] { "TABLE" });
        HashSet<String> tables = new HashSet<String>();
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IInteger

    }
  }

  public ISet getViewNames(IConstructor connection) {
    try {
      IInteger connectionId = (IInteger) connection.get(0);
      if (connectionMap.containsKey(connectionId)) {
        Connection conn = connectionMap.get(connectionId);
        DatabaseMetaData dmd = conn.getMetaData();
        ResultSet rs = dmd.getTables(null, null, null, new String[] { "VIEW" });
        HashSet<String> tables = new HashSet<String>();
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IInteger

  }
 
  private ISet getTablesOrViews(IConstructor connection, String[] tableTypes) {
    // TODO: Add code to check and make sure the table types are valid
    try {
      IInteger connectionId = (IInteger) connection.get(0);
      if (connectionMap.containsKey(connectionId)) {
        Connection conn = connectionMap.get(connectionId);
        DatabaseMetaData dmd = conn.getMetaData();
        ResultSet rs = dmd.getTables(null, null, null, tableTypes);
        HashSet<String> tables = new HashSet<String>();
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IInteger

  }
 
  // TODO: Handle the case where the table name does not exist
  public IConstructor getTable(IConstructor connection, IString tableName) {
    try {
      IInteger connectionId = (IInteger) connection.get(0);
      if (connectionMap.containsKey(connectionId)) {
        Connection conn = connectionMap.get(connectionId);
        DatabaseMetaData dmd = conn.getMetaData();
        ResultSet rs = dmd.getColumns(null, null, tableName.getValue(), null);
        IListWriter listRes = vf.listWriter(Column);
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IInteger

 
 
  // TODO: Add more error handling code...
  public IValue loadTable(IValue resultType, IConstructor connection, IString tableName) {
    try {
      IInteger connectionId = (IInteger) connection.get(0);
      if (connectionMap.containsKey(connectionId)) {
        Connection conn = connectionMap.get(connectionId);
        PreparedStatement stmt = conn.prepareStatement("SELECT * FROM " + tableName.getValue());
        ResultSet rs = stmt.executeQuery();
       
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IInteger

  }

  // TODO: Add more error handling code...
  public IValue loadTable(IConstructor connection, IString tableName) {
    try {
      IInteger connectionId = (IInteger) connection.get(0);
      if (connectionMap.containsKey(connectionId)) {
        Connection conn = connectionMap.get(connectionId);
        PreparedStatement stmt = conn.prepareStatement("SELECT * FROM " + tableName.getValue());
        ResultSet rs = stmt.executeQuery();
       
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IInteger

    }
  }

  public IValue loadTableOrdered(IValue resultType, IConstructor connection, IString tableName) {
    try {
      IInteger connectionId = (IInteger) connection.get(0);
      if (connectionMap.containsKey(connectionId)) {
        Connection conn = connectionMap.get(connectionId);
        PreparedStatement stmt = conn.prepareStatement("SELECT * FROM " + tableName.getValue());
        ResultSet rs = stmt.executeQuery();
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.