Package com.sun.star.sdbc

Examples of com.sun.star.sdbc.XStatement


    /** executes the given SQL statement via the defaultConnection
     */
    public void executeSQL( String statementString ) throws SQLException
    {
        XStatement statement = defaultConnection().createStatement();
        statement.execute( statementString );
    }
View Full Code Here


    sStatement += " WHERE 0=1";

    boolean bSuccess = false;
    try
    {
      XStatement xStatement = xConn.createStatement();
      xStatement.execute( sStatement );
      // if we reached this point, the table probably exists
      bSuccess = true;
    }
    catch(com.sun.star.sdbc.SQLException e)
    {
View Full Code Here

  */
  protected boolean implExecuteStatement( XConnection xConn, String sStatement ) throws java.lang.Exception
  {
    try
    {
      XStatement xStatement = xConn.createStatement( );
      xStatement.execute( sStatement );
    }
    catch(com.sun.star.sdbc.SQLException e)
    {
      System.err.println( e );
      return false;
View Full Code Here

        isolConnection = (XIsolatedConnection) UnoRuntime.queryInterface(
                                                     XIsolatedConnection.class,
                                                     oDBSource);

        XConnection connection = null;
        XStatement statement = null;

        final String tbl_name1 = "tst_table1";
        final String tbl_name2 = "tst_table2";
        final String col_name1 = "id1";
        final String col_name2 = "id2";

        try {
            connection = isolConnection.getIsolatedConnection(user, password);
            statement = connection.createStatement();
            statement.executeUpdate("drop table if exists " + tbl_name1);
            statement.executeUpdate("drop table if exists " + tbl_name2);
            statement.executeUpdate("create table " + tbl_name1 + " (" +
                                    col_name1 + " int)");
            statement.executeUpdate("create table " + tbl_name2 + " (" +
                                    col_name2 + " int)");
        } catch (com.sun.star.sdbc.SQLException e) {
            try {
                shortWait();
                connection = isolConnection.getIsolatedConnection(user,
                                                                  password);
                statement = connection.createStatement();
                statement.executeUpdate("drop table if exists " + tbl_name1);
                statement.executeUpdate("drop table if exists " + tbl_name2);
                statement.executeUpdate("create table " + tbl_name1 + " (" +
                                        col_name1 + " int)");
                statement.executeUpdate("create table " + tbl_name2 + " (" +
                                        col_name2 + " int)");
            } catch (com.sun.star.sdbc.SQLException e2) {
                e2.printStackTrace(log);
                throw new StatusException(Status.failed("SQLException"));
            }
View Full Code Here

    /** executes the given SQL statement via the defaultConnection
     */
    public void executeSQL(final String statementString) throws SQLException
    {
        final XStatement statement = defaultConnection().createStatement();
        statement.execute(statementString);
    }
View Full Code Here

        return m_connection;
    }

    public boolean execute( final String _sql ) throws SQLException
    {
        XStatement statement = createStatement();
        return statement.execute( _sql );
    }
View Full Code Here

        return statement.execute( _sql );
    }

    public XResultSet executeQuery( final String _sql ) throws SQLException
    {
        XStatement statement = createStatement();
        return statement.executeQuery( _sql );
    }
View Full Code Here

        return statement.executeQuery( _sql );
    }

    public int executeUpdate( final String _sql ) throws SQLException
    {
        XStatement statement = createStatement();
        return statement.executeUpdate( _sql );
    }
View Full Code Here

    /** executes the given SQL statement via the defaultConnection
     */
    public void executeSQL( String statementString ) throws SQLException
    {
        XStatement statement = defaultConnection().createStatement();
        statement.execute( statementString );
    }
View Full Code Here

    sStatement += " WHERE 0=1";

    boolean bSuccess = false;
    try
    {
      XStatement xStatement = xConn.createStatement();
      xStatement.execute( sStatement );
      // if we reached this point, the table probably exists
      bSuccess = true;
    }
    catch(com.sun.star.sdbc.SQLException e)
    {
View Full Code Here

TOP

Related Classes of com.sun.star.sdbc.XStatement

Copyright © 2018 www.massapicom. 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.