Generated basic javadoc for most methods. Still need some help here
Reformatteda all source using eclipse eliminated parameters with same names as method variagles repackaged all tests so that their package names match the directories they are in merged in Jiffie and Variant EventProxy changes
This commit is contained in:
@@ -1,120 +1,123 @@
|
||||
import com.jacob.com.*;
|
||||
|
||||
public class Command extends Dispatch
|
||||
{
|
||||
public Command()
|
||||
{
|
||||
super("ADODB.Command");
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is used instead of a case operation to
|
||||
* turn a Dispatch object into a wider object - it must exist
|
||||
* in every wrapper class whose instances may be returned from
|
||||
* method calls wrapped in VT_DISPATCH Variants.
|
||||
*/
|
||||
public Command(Dispatch d)
|
||||
{
|
||||
// take over the IDispatch pointer
|
||||
m_pDispatch = d.m_pDispatch;
|
||||
// null out the input's pointer
|
||||
d.m_pDispatch = 0;
|
||||
}
|
||||
|
||||
public Variant getProperties()
|
||||
{
|
||||
return Dispatch.get(this, "Properties");
|
||||
}
|
||||
|
||||
public Connection getActiveConnection()
|
||||
{
|
||||
return new Connection(Dispatch.get(this, "ActiveConnection").toDispatch());
|
||||
}
|
||||
|
||||
public void setActiveConnection(Connection ppvObject)
|
||||
{
|
||||
Dispatch.put(this, "ActiveConnection", ppvObject);
|
||||
}
|
||||
|
||||
public String getCommandText()
|
||||
{
|
||||
return Dispatch.get(this, "CommandText").toString();
|
||||
}
|
||||
|
||||
public void setCommandText(String pbstr)
|
||||
{
|
||||
Dispatch.put(this, "CommandText", pbstr);
|
||||
}
|
||||
|
||||
public int getCommandTimeout()
|
||||
{
|
||||
return Dispatch.get(this, "CommandTimeout").toInt();
|
||||
}
|
||||
|
||||
public void setCommandTimeout(int plTimeout)
|
||||
{
|
||||
Dispatch.put(this, "CommandTimeout", new Variant(plTimeout));
|
||||
}
|
||||
|
||||
public boolean getPrepared()
|
||||
{
|
||||
return Dispatch.get(this, "Prepared").toBoolean();
|
||||
}
|
||||
|
||||
public void setPrepared(boolean pfPrepared)
|
||||
{
|
||||
Dispatch.put(this, "Prepared", new Variant(pfPrepared));
|
||||
}
|
||||
|
||||
public Recordset Execute(Variant RecordsAffected, Variant Parameters, int Options)
|
||||
{
|
||||
return (Recordset)Dispatch.call(this, "Execute", RecordsAffected, Parameters, new Variant(Options)).toDispatch();
|
||||
}
|
||||
|
||||
public Recordset Execute()
|
||||
{
|
||||
Variant dummy = new Variant();
|
||||
return new Recordset(Dispatch.call(this, "Execute", dummy).toDispatch());
|
||||
}
|
||||
|
||||
public Variant CreateParameter(String Name, int Type, int Direction, int Size, Variant Value)
|
||||
{
|
||||
return Dispatch.call(this, "CreateParameter", Name, new Variant(Type), new Variant(Direction), new Variant(Size), Value);
|
||||
}
|
||||
|
||||
// need to wrap Parameters
|
||||
public Variant getParameters()
|
||||
{
|
||||
return Dispatch.get(this, "Parameters");
|
||||
}
|
||||
|
||||
public void setCommandType(int plCmdType)
|
||||
{
|
||||
Dispatch.put(this, "CommandType", new Variant(plCmdType));
|
||||
}
|
||||
|
||||
public int getCommandType()
|
||||
{
|
||||
return Dispatch.get(this, "CommandType").toInt();
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return Dispatch.get(this, "Name").toString();
|
||||
}
|
||||
|
||||
public void setName(String pbstrName)
|
||||
{
|
||||
Dispatch.put(this, "Name", pbstrName);
|
||||
}
|
||||
|
||||
public int getState()
|
||||
{
|
||||
return Dispatch.get(this, "State").toInt();
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
Dispatch.call(this, "Cancel");
|
||||
}
|
||||
}
|
||||
package samples.ado;
|
||||
|
||||
import com.jacob.com.*;
|
||||
|
||||
public class Command extends Dispatch
|
||||
{
|
||||
public Command()
|
||||
{
|
||||
super("ADODB.Command");
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is used instead of a case operation to
|
||||
* turn a Dispatch object into a wider object - it must exist
|
||||
* in every wrapper class whose instances may be returned from
|
||||
* method calls wrapped in VT_DISPATCH Variants.
|
||||
* @param dispatchTarget
|
||||
*/
|
||||
public Command(Dispatch dispatchTarget)
|
||||
{
|
||||
// take over the IDispatch pointer
|
||||
m_pDispatch = dispatchTarget.m_pDispatch;
|
||||
// null out the input's pointer
|
||||
dispatchTarget.m_pDispatch = 0;
|
||||
}
|
||||
|
||||
public Variant getProperties()
|
||||
{
|
||||
return Dispatch.get(this, "Properties");
|
||||
}
|
||||
|
||||
public Connection getActiveConnection()
|
||||
{
|
||||
return new Connection(Dispatch.get(this, "ActiveConnection").toDispatch());
|
||||
}
|
||||
|
||||
public void setActiveConnection(Connection ppvObject)
|
||||
{
|
||||
Dispatch.put(this, "ActiveConnection", ppvObject);
|
||||
}
|
||||
|
||||
public String getCommandText()
|
||||
{
|
||||
return Dispatch.get(this, "CommandText").toString();
|
||||
}
|
||||
|
||||
public void setCommandText(String pbstr)
|
||||
{
|
||||
Dispatch.put(this, "CommandText", pbstr);
|
||||
}
|
||||
|
||||
public int getCommandTimeout()
|
||||
{
|
||||
return Dispatch.get(this, "CommandTimeout").toInt();
|
||||
}
|
||||
|
||||
public void setCommandTimeout(int plTimeout)
|
||||
{
|
||||
Dispatch.put(this, "CommandTimeout", new Variant(plTimeout));
|
||||
}
|
||||
|
||||
public boolean getPrepared()
|
||||
{
|
||||
return Dispatch.get(this, "Prepared").toBoolean();
|
||||
}
|
||||
|
||||
public void setPrepared(boolean pfPrepared)
|
||||
{
|
||||
Dispatch.put(this, "Prepared", new Variant(pfPrepared));
|
||||
}
|
||||
|
||||
public Recordset Execute(Variant RecordsAffected, Variant Parameters, int Options)
|
||||
{
|
||||
return (Recordset)Dispatch.call(this, "Execute", RecordsAffected, Parameters, new Variant(Options)).toDispatch();
|
||||
}
|
||||
|
||||
public Recordset Execute()
|
||||
{
|
||||
Variant dummy = new Variant();
|
||||
return new Recordset(Dispatch.call(this, "Execute", dummy).toDispatch());
|
||||
}
|
||||
|
||||
public Variant CreateParameter(String Name, int Type, int Direction, int Size, Variant Value)
|
||||
{
|
||||
return Dispatch.call(this, "CreateParameter", Name, new Variant(Type), new Variant(Direction), new Variant(Size), Value);
|
||||
}
|
||||
|
||||
// need to wrap Parameters
|
||||
public Variant getParameters()
|
||||
{
|
||||
return Dispatch.get(this, "Parameters");
|
||||
}
|
||||
|
||||
public void setCommandType(int plCmdType)
|
||||
{
|
||||
Dispatch.put(this, "CommandType", new Variant(plCmdType));
|
||||
}
|
||||
|
||||
public int getCommandType()
|
||||
{
|
||||
return Dispatch.get(this, "CommandType").toInt();
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return Dispatch.get(this, "Name").toString();
|
||||
}
|
||||
|
||||
public void setName(String pbstrName)
|
||||
{
|
||||
Dispatch.put(this, "Name", pbstrName);
|
||||
}
|
||||
|
||||
public int getState()
|
||||
{
|
||||
return Dispatch.get(this, "State").toInt();
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
Dispatch.call(this, "Cancel");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
// Enum: CommandTypeEnum
|
||||
|
||||
public interface CommandTypeEnum
|
||||
{
|
||||
public static final int adCmdUnspecified = -1;
|
||||
public static final int adCmdUnknown = 8;
|
||||
public static final int adCmdText = 1;
|
||||
public static final int adCmdTable = 2;
|
||||
public static final int adCmdStoredProc = 4;
|
||||
public static final int adCmdFile = 256;
|
||||
public static final int adCmdTableDirect = 512;
|
||||
}
|
||||
package samples.ado;
|
||||
|
||||
// Enum: CommandTypeEnum
|
||||
|
||||
public interface CommandTypeEnum
|
||||
{
|
||||
public static final int adCmdUnspecified = -1;
|
||||
public static final int adCmdUnknown = 8;
|
||||
public static final int adCmdText = 1;
|
||||
public static final int adCmdTable = 2;
|
||||
public static final int adCmdStoredProc = 4;
|
||||
public static final int adCmdFile = 256;
|
||||
public static final int adCmdTableDirect = 512;
|
||||
}
|
||||
|
||||
@@ -1,180 +1,182 @@
|
||||
import com.jacob.com.*;
|
||||
|
||||
public class Connection extends Dispatch
|
||||
{
|
||||
public Connection()
|
||||
{
|
||||
super("ADODB.Connection");
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is used instead of a case operation to
|
||||
* turn a Dispatch object into a wider object - it must exist
|
||||
* in every wrapper class whose instances may be returned from
|
||||
* method calls wrapped in VT_DISPATCH Variants.
|
||||
*/
|
||||
public Connection(Dispatch d)
|
||||
{
|
||||
// take over the IDispatch pointer
|
||||
m_pDispatch = d.m_pDispatch;
|
||||
// null out the input's pointer
|
||||
d.m_pDispatch = 0;
|
||||
}
|
||||
|
||||
// need to wrap Properties
|
||||
public Variant getProperties()
|
||||
{
|
||||
return Dispatch.get(this, "Properties");
|
||||
}
|
||||
|
||||
public String getConnectionString()
|
||||
{
|
||||
return Dispatch.get(this, "ConnectionString").toString();
|
||||
}
|
||||
|
||||
public void setConnectionString(String pbstr)
|
||||
{
|
||||
Dispatch.put(this, "ConnectionString", pbstr);
|
||||
}
|
||||
|
||||
public int getCommandTimeout()
|
||||
{
|
||||
return Dispatch.get(this, "CommandTimeout").toInt();
|
||||
}
|
||||
|
||||
public void setCommandTimeout(int plTimeout)
|
||||
{
|
||||
Dispatch.put(this, "CommandTimeout", new Variant(plTimeout));
|
||||
}
|
||||
|
||||
public int getConnectionTimeout()
|
||||
{
|
||||
return Dispatch.get(this, "ConnectionTimeout").toInt();
|
||||
}
|
||||
|
||||
public void setConnectionTimeout(int plTimeout)
|
||||
{
|
||||
Dispatch.put(this, "ConnectionTimeout", new Variant(plTimeout));
|
||||
}
|
||||
|
||||
public String getVersion()
|
||||
{
|
||||
return Dispatch.get(this, "Version").toString();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Dispatch.call(this, "Close");
|
||||
}
|
||||
|
||||
// how to deal with RecordsAffected being output?
|
||||
public Variant Execute(String CommandText, Variant RecordsAffected, int Options)
|
||||
{
|
||||
return Dispatch.call(this, CommandText, RecordsAffected, new Variant(Options));
|
||||
}
|
||||
|
||||
public int BeginTrans()
|
||||
{
|
||||
return Dispatch.call(this, "BeginTrans").toInt();
|
||||
}
|
||||
|
||||
public void CommitTrans()
|
||||
{
|
||||
Dispatch.call(this, "CommitTrans");
|
||||
}
|
||||
|
||||
public void RollbackTrans()
|
||||
{
|
||||
Dispatch.call(this, "RollbackTrans");
|
||||
}
|
||||
|
||||
public void Open(String ConnectionString, String UserID, String Password, int Options)
|
||||
{
|
||||
Dispatch.call(this, "Open", ConnectionString, UserID, Password, new Variant(Options));
|
||||
}
|
||||
|
||||
public void Open()
|
||||
{
|
||||
Dispatch.call(this, "Open");
|
||||
}
|
||||
|
||||
public Variant getErrors()
|
||||
{
|
||||
return Dispatch.get(this, "Errors");
|
||||
}
|
||||
|
||||
public String getDefaultDatabase()
|
||||
{
|
||||
return Dispatch.get(this, "DefaultDatabase").toString();
|
||||
}
|
||||
|
||||
public void setDefaultDatabase(String pbstr)
|
||||
{
|
||||
Dispatch.put(this, "DefaultDatabase", pbstr);
|
||||
}
|
||||
|
||||
public int getIsolationLevel()
|
||||
{
|
||||
return Dispatch.get(this, "IsolationLevel").toInt();
|
||||
}
|
||||
|
||||
public void setIsolationLevel(int Level)
|
||||
{
|
||||
Dispatch.put(this, "IsolationLevel", new Variant(Level));
|
||||
}
|
||||
|
||||
public int getAttributes()
|
||||
{
|
||||
return Dispatch.get(this, "Attributes").toInt();
|
||||
}
|
||||
|
||||
public void setAttributes(int plAttr)
|
||||
{
|
||||
Dispatch.put(this, "Attributes", new Variant(plAttr));
|
||||
}
|
||||
|
||||
public int getCursorLocation()
|
||||
{
|
||||
return Dispatch.get(this, "CursorLocation").toInt();
|
||||
}
|
||||
|
||||
public void setCursorLocation(int plCursorLoc)
|
||||
{
|
||||
Dispatch.put(this, "CursorLocation", new Variant(plCursorLoc));
|
||||
}
|
||||
|
||||
public int getMode()
|
||||
{
|
||||
return Dispatch.get(this, "Mode").toInt();
|
||||
}
|
||||
|
||||
public void setMode(int plMode)
|
||||
{
|
||||
Dispatch.put(this, "Mode", new Variant(plMode));
|
||||
}
|
||||
|
||||
public String getProvider()
|
||||
{
|
||||
return Dispatch.get(this, "Provider").toString();
|
||||
}
|
||||
|
||||
public void setProvider(String pbstr)
|
||||
{
|
||||
Dispatch.put(this, "Provider", pbstr);
|
||||
}
|
||||
|
||||
public int getState()
|
||||
{
|
||||
return Dispatch.get(this, "State").toInt();
|
||||
}
|
||||
|
||||
public Variant OpenSchema(int Schema, Variant Restrictions, Variant SchemaID)
|
||||
{
|
||||
return Dispatch.call(this, "OpenSchema", new Variant(Schema), Restrictions, SchemaID);
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
Dispatch.call(this, "Cancel");
|
||||
}
|
||||
}
|
||||
package samples.ado;
|
||||
|
||||
import com.jacob.com.*;
|
||||
|
||||
public class Connection extends Dispatch
|
||||
{
|
||||
public Connection()
|
||||
{
|
||||
super("ADODB.Connection");
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is used instead of a case operation to
|
||||
* turn a Dispatch object into a wider object - it must exist
|
||||
* in every wrapper class whose instances may be returned from
|
||||
* method calls wrapped in VT_DISPATCH Variants.
|
||||
*/
|
||||
public Connection(Dispatch d)
|
||||
{
|
||||
// take over the IDispatch pointer
|
||||
m_pDispatch = d.m_pDispatch;
|
||||
// null out the input's pointer
|
||||
d.m_pDispatch = 0;
|
||||
}
|
||||
|
||||
// need to wrap Properties
|
||||
public Variant getProperties()
|
||||
{
|
||||
return Dispatch.get(this, "Properties");
|
||||
}
|
||||
|
||||
public String getConnectionString()
|
||||
{
|
||||
return Dispatch.get(this, "ConnectionString").toString();
|
||||
}
|
||||
|
||||
public void setConnectionString(String pbstr)
|
||||
{
|
||||
Dispatch.put(this, "ConnectionString", pbstr);
|
||||
}
|
||||
|
||||
public int getCommandTimeout()
|
||||
{
|
||||
return Dispatch.get(this, "CommandTimeout").toInt();
|
||||
}
|
||||
|
||||
public void setCommandTimeout(int plTimeout)
|
||||
{
|
||||
Dispatch.put(this, "CommandTimeout", new Variant(plTimeout));
|
||||
}
|
||||
|
||||
public int getConnectionTimeout()
|
||||
{
|
||||
return Dispatch.get(this, "ConnectionTimeout").toInt();
|
||||
}
|
||||
|
||||
public void setConnectionTimeout(int plTimeout)
|
||||
{
|
||||
Dispatch.put(this, "ConnectionTimeout", new Variant(plTimeout));
|
||||
}
|
||||
|
||||
public String getVersion()
|
||||
{
|
||||
return Dispatch.get(this, "Version").toString();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Dispatch.call(this, "Close");
|
||||
}
|
||||
|
||||
// how to deal with RecordsAffected being output?
|
||||
public Variant Execute(String CommandText, Variant RecordsAffected, int Options)
|
||||
{
|
||||
return Dispatch.call(this, CommandText, RecordsAffected, new Variant(Options));
|
||||
}
|
||||
|
||||
public int BeginTrans()
|
||||
{
|
||||
return Dispatch.call(this, "BeginTrans").toInt();
|
||||
}
|
||||
|
||||
public void CommitTrans()
|
||||
{
|
||||
Dispatch.call(this, "CommitTrans");
|
||||
}
|
||||
|
||||
public void RollbackTrans()
|
||||
{
|
||||
Dispatch.call(this, "RollbackTrans");
|
||||
}
|
||||
|
||||
public void Open(String ConnectionString, String UserID, String Password, int Options)
|
||||
{
|
||||
Dispatch.call(this, "Open", ConnectionString, UserID, Password, new Variant(Options));
|
||||
}
|
||||
|
||||
public void Open()
|
||||
{
|
||||
Dispatch.call(this, "Open");
|
||||
}
|
||||
|
||||
public Variant getErrors()
|
||||
{
|
||||
return Dispatch.get(this, "Errors");
|
||||
}
|
||||
|
||||
public String getDefaultDatabase()
|
||||
{
|
||||
return Dispatch.get(this, "DefaultDatabase").toString();
|
||||
}
|
||||
|
||||
public void setDefaultDatabase(String pbstr)
|
||||
{
|
||||
Dispatch.put(this, "DefaultDatabase", pbstr);
|
||||
}
|
||||
|
||||
public int getIsolationLevel()
|
||||
{
|
||||
return Dispatch.get(this, "IsolationLevel").toInt();
|
||||
}
|
||||
|
||||
public void setIsolationLevel(int Level)
|
||||
{
|
||||
Dispatch.put(this, "IsolationLevel", new Variant(Level));
|
||||
}
|
||||
|
||||
public int getAttributes()
|
||||
{
|
||||
return Dispatch.get(this, "Attributes").toInt();
|
||||
}
|
||||
|
||||
public void setAttributes(int plAttr)
|
||||
{
|
||||
Dispatch.put(this, "Attributes", new Variant(plAttr));
|
||||
}
|
||||
|
||||
public int getCursorLocation()
|
||||
{
|
||||
return Dispatch.get(this, "CursorLocation").toInt();
|
||||
}
|
||||
|
||||
public void setCursorLocation(int plCursorLoc)
|
||||
{
|
||||
Dispatch.put(this, "CursorLocation", new Variant(plCursorLoc));
|
||||
}
|
||||
|
||||
public int getMode()
|
||||
{
|
||||
return Dispatch.get(this, "Mode").toInt();
|
||||
}
|
||||
|
||||
public void setMode(int plMode)
|
||||
{
|
||||
Dispatch.put(this, "Mode", new Variant(plMode));
|
||||
}
|
||||
|
||||
public String getProvider()
|
||||
{
|
||||
return Dispatch.get(this, "Provider").toString();
|
||||
}
|
||||
|
||||
public void setProvider(String pbstr)
|
||||
{
|
||||
Dispatch.put(this, "Provider", pbstr);
|
||||
}
|
||||
|
||||
public int getState()
|
||||
{
|
||||
return Dispatch.get(this, "State").toInt();
|
||||
}
|
||||
|
||||
public Variant OpenSchema(int Schema, Variant Restrictions, Variant SchemaID)
|
||||
{
|
||||
return Dispatch.call(this, "OpenSchema", new Variant(Schema), Restrictions, SchemaID);
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
Dispatch.call(this, "Cancel");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,124 +1,125 @@
|
||||
import com.jacob.com.*;
|
||||
|
||||
public class Field extends Dispatch
|
||||
{
|
||||
/**
|
||||
* This constructor is used instead of a case operation to
|
||||
* turn a Dispatch object into a wider object - it must exist
|
||||
* in every wrapper class whose instances may be returned from
|
||||
* method calls wrapped in VT_DISPATCH Variants.
|
||||
*/
|
||||
public Field(Dispatch d)
|
||||
{
|
||||
// take over the IDispatch pointer
|
||||
m_pDispatch = d.m_pDispatch;
|
||||
// null out the input's pointer
|
||||
d.m_pDispatch = 0;
|
||||
}
|
||||
|
||||
public Variant getProperties()
|
||||
{
|
||||
return Dispatch.get(this, "Properties");
|
||||
}
|
||||
|
||||
public int getActualSize()
|
||||
{
|
||||
return Dispatch.get(this, "ActualSize").toInt();
|
||||
}
|
||||
|
||||
public int getAttributes()
|
||||
{
|
||||
return Dispatch.get(this, "Attributes").toInt();
|
||||
}
|
||||
|
||||
public int getDefinedSize()
|
||||
{
|
||||
return Dispatch.get(this, "DefinedSize").toInt();
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return Dispatch.get(this, "Name").toString();
|
||||
}
|
||||
|
||||
public int getType()
|
||||
{
|
||||
return Dispatch.get(this, "Type").toInt();
|
||||
}
|
||||
|
||||
public Variant getValue()
|
||||
{
|
||||
return Dispatch.get(this, "Value");
|
||||
}
|
||||
|
||||
public void setValue(Variant pvar)
|
||||
{
|
||||
Dispatch.put(this, "Value", pvar);
|
||||
}
|
||||
|
||||
public byte getPrecision()
|
||||
{
|
||||
return Dispatch.get(this, "Precision").toByte();
|
||||
}
|
||||
|
||||
public byte getNumericScale()
|
||||
{
|
||||
return Dispatch.get(this, "NumericScale").toByte();
|
||||
}
|
||||
|
||||
public void AppendChunk(Variant Data)
|
||||
{
|
||||
Dispatch.call(this, "AppendChunk", Data);
|
||||
}
|
||||
|
||||
public Variant GetChunk(int Length)
|
||||
{
|
||||
return Dispatch.call(this, "GetChunk", new Variant(Length));
|
||||
}
|
||||
|
||||
public Variant getOriginalValue()
|
||||
{
|
||||
return Dispatch.get(this, "OriginalValue");
|
||||
}
|
||||
|
||||
public Variant getUnderlyingValue()
|
||||
{
|
||||
return Dispatch.get(this, "UnderlyingValue");
|
||||
}
|
||||
|
||||
public Variant getDataFormat()
|
||||
{
|
||||
return Dispatch.get(this, "DataFormat");
|
||||
}
|
||||
|
||||
public void setDataFormat(Variant ppiDF)
|
||||
{
|
||||
Dispatch.put(this, "DataFormat", ppiDF);
|
||||
}
|
||||
|
||||
public void setPrecision(byte pb)
|
||||
{
|
||||
Dispatch.put(this, "Precision", new Variant(pb));
|
||||
}
|
||||
|
||||
public void setNumericScale(byte pb)
|
||||
{
|
||||
Dispatch.put(this, "NumericScale", new Variant(pb));
|
||||
}
|
||||
|
||||
public void setType(int pDataType)
|
||||
{
|
||||
Dispatch.put(this, "Type", new Variant(pDataType));
|
||||
}
|
||||
|
||||
public void setDefinedSize(int pl)
|
||||
{
|
||||
Dispatch.put(this, "DefinedSize", new Variant(pl));
|
||||
}
|
||||
|
||||
public void setAttributes(int pl)
|
||||
{
|
||||
Dispatch.put(this, "Attributes", new Variant(pl));
|
||||
}
|
||||
|
||||
}
|
||||
package samples.ado;
|
||||
import com.jacob.com.*;
|
||||
|
||||
public class Field extends Dispatch
|
||||
{
|
||||
/**
|
||||
* This constructor is used instead of a case operation to
|
||||
* turn a Dispatch object into a wider object - it must exist
|
||||
* in every wrapper class whose instances may be returned from
|
||||
* method calls wrapped in VT_DISPATCH Variants.
|
||||
*/
|
||||
public Field(Dispatch d)
|
||||
{
|
||||
// take over the IDispatch pointer
|
||||
m_pDispatch = d.m_pDispatch;
|
||||
// null out the input's pointer
|
||||
d.m_pDispatch = 0;
|
||||
}
|
||||
|
||||
public Variant getProperties()
|
||||
{
|
||||
return Dispatch.get(this, "Properties");
|
||||
}
|
||||
|
||||
public int getActualSize()
|
||||
{
|
||||
return Dispatch.get(this, "ActualSize").toInt();
|
||||
}
|
||||
|
||||
public int getAttributes()
|
||||
{
|
||||
return Dispatch.get(this, "Attributes").toInt();
|
||||
}
|
||||
|
||||
public int getDefinedSize()
|
||||
{
|
||||
return Dispatch.get(this, "DefinedSize").toInt();
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return Dispatch.get(this, "Name").toString();
|
||||
}
|
||||
|
||||
public int getType()
|
||||
{
|
||||
return Dispatch.get(this, "Type").toInt();
|
||||
}
|
||||
|
||||
public Variant getValue()
|
||||
{
|
||||
return Dispatch.get(this, "Value");
|
||||
}
|
||||
|
||||
public void setValue(Variant pvar)
|
||||
{
|
||||
Dispatch.put(this, "Value", pvar);
|
||||
}
|
||||
|
||||
public byte getPrecision()
|
||||
{
|
||||
return Dispatch.get(this, "Precision").toByte();
|
||||
}
|
||||
|
||||
public byte getNumericScale()
|
||||
{
|
||||
return Dispatch.get(this, "NumericScale").toByte();
|
||||
}
|
||||
|
||||
public void AppendChunk(Variant Data)
|
||||
{
|
||||
Dispatch.call(this, "AppendChunk", Data);
|
||||
}
|
||||
|
||||
public Variant GetChunk(int Length)
|
||||
{
|
||||
return Dispatch.call(this, "GetChunk", new Variant(Length));
|
||||
}
|
||||
|
||||
public Variant getOriginalValue()
|
||||
{
|
||||
return Dispatch.get(this, "OriginalValue");
|
||||
}
|
||||
|
||||
public Variant getUnderlyingValue()
|
||||
{
|
||||
return Dispatch.get(this, "UnderlyingValue");
|
||||
}
|
||||
|
||||
public Variant getDataFormat()
|
||||
{
|
||||
return Dispatch.get(this, "DataFormat");
|
||||
}
|
||||
|
||||
public void setDataFormat(Variant ppiDF)
|
||||
{
|
||||
Dispatch.put(this, "DataFormat", ppiDF);
|
||||
}
|
||||
|
||||
public void setPrecision(byte pb)
|
||||
{
|
||||
Dispatch.put(this, "Precision", new Variant(pb));
|
||||
}
|
||||
|
||||
public void setNumericScale(byte pb)
|
||||
{
|
||||
Dispatch.put(this, "NumericScale", new Variant(pb));
|
||||
}
|
||||
|
||||
public void setType(int pDataType)
|
||||
{
|
||||
Dispatch.put(this, "Type", new Variant(pDataType));
|
||||
}
|
||||
|
||||
public void setDefinedSize(int pl)
|
||||
{
|
||||
Dispatch.put(this, "DefinedSize", new Variant(pl));
|
||||
}
|
||||
|
||||
public void setAttributes(int pl)
|
||||
{
|
||||
Dispatch.put(this, "Attributes", new Variant(pl));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,50 +1,51 @@
|
||||
import com.jacob.com.*;
|
||||
|
||||
public class Fields extends Dispatch
|
||||
{
|
||||
/**
|
||||
* This constructor is used instead of a case operation to
|
||||
* turn a Dispatch object into a wider object - it must exist
|
||||
* in every wrapper class whose instances may be returned from
|
||||
* method calls wrapped in VT_DISPATCH Variants.
|
||||
*/
|
||||
public Fields(Dispatch d)
|
||||
{
|
||||
// take over the IDispatch pointer
|
||||
m_pDispatch = d.m_pDispatch;
|
||||
// null out the input's pointer
|
||||
d.m_pDispatch = 0;
|
||||
}
|
||||
|
||||
public int getCount()
|
||||
{
|
||||
return Dispatch.get(this, "Count").toInt();
|
||||
}
|
||||
|
||||
public Variant _NewEnum()
|
||||
{
|
||||
return Dispatch.call(this, "_NewEnum");
|
||||
}
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
Dispatch.call(this, "Refresh");
|
||||
}
|
||||
|
||||
public Field getItem(int Index)
|
||||
{
|
||||
return new Field(Dispatch.call(this, "Item", new Variant(Index)).toDispatch());
|
||||
}
|
||||
|
||||
public void Append(String Name, int Type, int DefinedSize, int Attrib)
|
||||
{
|
||||
Dispatch.call(this, "Append", Name, new Variant(Type),
|
||||
new Variant(DefinedSize), new Variant(Attrib));
|
||||
}
|
||||
|
||||
public void Delete(Variant Index)
|
||||
{
|
||||
Dispatch.call(this, "Delete", Index);
|
||||
}
|
||||
|
||||
}
|
||||
package samples.ado;
|
||||
import com.jacob.com.*;
|
||||
|
||||
public class Fields extends Dispatch
|
||||
{
|
||||
/**
|
||||
* This constructor is used instead of a case operation to
|
||||
* turn a Dispatch object into a wider object - it must exist
|
||||
* in every wrapper class whose instances may be returned from
|
||||
* method calls wrapped in VT_DISPATCH Variants.
|
||||
*/
|
||||
public Fields(Dispatch d)
|
||||
{
|
||||
// take over the IDispatch pointer
|
||||
m_pDispatch = d.m_pDispatch;
|
||||
// null out the input's pointer
|
||||
d.m_pDispatch = 0;
|
||||
}
|
||||
|
||||
public int getCount()
|
||||
{
|
||||
return Dispatch.get(this, "Count").toInt();
|
||||
}
|
||||
|
||||
public Variant _NewEnum()
|
||||
{
|
||||
return Dispatch.call(this, "_NewEnum");
|
||||
}
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
Dispatch.call(this, "Refresh");
|
||||
}
|
||||
|
||||
public Field getItem(int Index)
|
||||
{
|
||||
return new Field(Dispatch.call(this, "Item", new Variant(Index)).toDispatch());
|
||||
}
|
||||
|
||||
public void Append(String Name, int Type, int DefinedSize, int Attrib)
|
||||
{
|
||||
Dispatch.call(this, "Append", Name, new Variant(Type),
|
||||
new Variant(DefinedSize), new Variant(Attrib));
|
||||
}
|
||||
|
||||
public void Delete(Variant Index)
|
||||
{
|
||||
Dispatch.call(this, "Delete", Index);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,411 +1,412 @@
|
||||
import com.jacob.com.*;
|
||||
|
||||
public class Recordset extends Dispatch
|
||||
{
|
||||
public Recordset()
|
||||
{
|
||||
super("ADODB.Recordset");
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is used instead of a case operation to
|
||||
* turn a Dispatch object into a wider object - it must exist
|
||||
* in every wrapper class whose instances may be returned from
|
||||
* method calls wrapped in VT_DISPATCH Variants.
|
||||
*/
|
||||
public Recordset(Dispatch d)
|
||||
{
|
||||
// take over the IDispatch pointer
|
||||
m_pDispatch = d.m_pDispatch;
|
||||
// null out the input's pointer
|
||||
d.m_pDispatch = 0;
|
||||
}
|
||||
|
||||
public Variant getProperties()
|
||||
{
|
||||
return Dispatch.get(this, "Properties");
|
||||
}
|
||||
|
||||
public int getAbsolutePosition()
|
||||
{
|
||||
return Dispatch.get(this, "AbsolutePosition").toInt();
|
||||
}
|
||||
|
||||
public void setAbsolutePosition(int pl)
|
||||
{
|
||||
Dispatch.put(this, "AbsolutePosition", new Variant(pl));
|
||||
}
|
||||
|
||||
public Connection getActiveConnection()
|
||||
{
|
||||
return new Connection(Dispatch.get(this, "ActiveConnection").toDispatch());
|
||||
}
|
||||
|
||||
public void setActiveConnection(Connection ppvObject)
|
||||
{
|
||||
Dispatch.put(this, "ActiveConnection", ppvObject);
|
||||
}
|
||||
|
||||
public void setActiveConnection(Variant ppvObject)
|
||||
{
|
||||
Dispatch.put(this, "ActiveConnection", ppvObject);
|
||||
}
|
||||
|
||||
public boolean getBOF()
|
||||
{
|
||||
return Dispatch.get(this, "BOF").toBoolean();
|
||||
}
|
||||
|
||||
public Variant getBookmark()
|
||||
{
|
||||
return Dispatch.get(this, "Bookmark");
|
||||
}
|
||||
|
||||
public void setBookmark(Variant pvBookmark)
|
||||
{
|
||||
Dispatch.put(this, "Bookmark", pvBookmark);
|
||||
}
|
||||
|
||||
public int getCacheSize()
|
||||
{
|
||||
return Dispatch.get(this, "CacheSize").toInt();
|
||||
}
|
||||
|
||||
public void setCacheSize(int pl)
|
||||
{
|
||||
Dispatch.put(this, "CacheSize", new Variant(pl));
|
||||
}
|
||||
|
||||
public int getCursorType()
|
||||
{
|
||||
return Dispatch.get(this, "CursorType").toInt();
|
||||
}
|
||||
|
||||
public void setCursorType(int pl)
|
||||
{
|
||||
Dispatch.put(this, "CursorType", new Variant(pl));
|
||||
}
|
||||
|
||||
public boolean getEOF()
|
||||
{
|
||||
return Dispatch.get(this, "EOF").toBoolean();
|
||||
}
|
||||
|
||||
public Fields getFields()
|
||||
{
|
||||
return new Fields(Dispatch.get(this, "Fields").toDispatch());
|
||||
}
|
||||
|
||||
public int getLockType()
|
||||
{
|
||||
return Dispatch.get(this, "LockType").toInt();
|
||||
}
|
||||
|
||||
public void setLockType(int plLockType)
|
||||
{
|
||||
Dispatch.put(this, "LockType", new Variant(plLockType));
|
||||
}
|
||||
|
||||
public int getMaxRecords()
|
||||
{
|
||||
return Dispatch.get(this, "MaxRecords").toInt();
|
||||
}
|
||||
|
||||
public void setMaxRecords(int pl)
|
||||
{
|
||||
Dispatch.put(this, "MaxRecords", new Variant(pl));
|
||||
}
|
||||
|
||||
public int getRecordCount()
|
||||
{
|
||||
return Dispatch.get(this, "RecordCount").toInt();
|
||||
}
|
||||
|
||||
public void setSource(Object pvSource)
|
||||
{
|
||||
Dispatch.put(this, "Source", pvSource);
|
||||
}
|
||||
|
||||
public void setSource(String pvSource)
|
||||
{
|
||||
Dispatch.put(this, "Source", pvSource);
|
||||
}
|
||||
|
||||
public Variant getSource()
|
||||
{
|
||||
return Dispatch.get(this, "Source");
|
||||
}
|
||||
|
||||
public void AddNew(Variant FieldList, Variant Values)
|
||||
{
|
||||
Dispatch.call(this, "AddNew", FieldList, Values);
|
||||
}
|
||||
|
||||
public void CancelUpdate()
|
||||
{
|
||||
Dispatch.call(this, "CancelUpdate");
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Dispatch.call(this, "Close");
|
||||
}
|
||||
|
||||
public void Delete(int AffectRecords)
|
||||
{
|
||||
Dispatch.call(this, "Delete", new Variant(AffectRecords));
|
||||
}
|
||||
|
||||
public Variant GetRows(int Rows, Variant Start, Variant Fields)
|
||||
{
|
||||
return Dispatch.call(this, "GetRows", new Variant(Rows), Start, Fields);
|
||||
}
|
||||
|
||||
// get all rows
|
||||
public Variant GetRows()
|
||||
{
|
||||
return Dispatch.call(this, "GetRows");
|
||||
}
|
||||
|
||||
public void Move(int NumRecords, Variant Start)
|
||||
{
|
||||
Dispatch.call(this, "Move", new Variant(NumRecords), Start);
|
||||
}
|
||||
|
||||
public void MoveNext()
|
||||
{
|
||||
Dispatch.call(this, "MoveNext");
|
||||
}
|
||||
|
||||
public void MovePrevious()
|
||||
{
|
||||
Dispatch.call(this, "MovePrevious");
|
||||
}
|
||||
|
||||
public void MoveFirst()
|
||||
{
|
||||
Dispatch.call(this, "MoveFirst");
|
||||
}
|
||||
|
||||
public void MoveLast()
|
||||
{
|
||||
Dispatch.call(this, "MoveLast");
|
||||
}
|
||||
|
||||
public void Open(Variant Source, Variant ActiveConnection, int CursorType, int LockType, int Options)
|
||||
{
|
||||
Dispatch.call(this, "Open", Source, ActiveConnection, new Variant(CursorType), new Variant(LockType), new Variant(Options));
|
||||
}
|
||||
|
||||
public void Open(Variant Source, Variant ActiveConnection)
|
||||
{
|
||||
Dispatch.call(this, "Open", Source, ActiveConnection);
|
||||
}
|
||||
|
||||
public void Requery(int Options)
|
||||
{
|
||||
Dispatch.call(this, "Requery", new Variant(Options));
|
||||
}
|
||||
|
||||
public void Update(Variant Fields, Variant Values)
|
||||
{
|
||||
Dispatch.call(this, "Update", Fields, Values);
|
||||
}
|
||||
|
||||
public int getAbsolutePage()
|
||||
{
|
||||
return Dispatch.get(this, "AbsolutePage").toInt();
|
||||
}
|
||||
|
||||
public void setAbsolutePage(int pl)
|
||||
{
|
||||
Dispatch.put(this, "AbsolutePage", new Variant(pl));
|
||||
}
|
||||
|
||||
public int getEditMode()
|
||||
{
|
||||
return Dispatch.get(this, "EditMode").toInt();
|
||||
}
|
||||
|
||||
public Variant getFilter()
|
||||
{
|
||||
return Dispatch.get(this, "Filter");
|
||||
}
|
||||
|
||||
public void setFilter(Variant Criteria)
|
||||
{
|
||||
Dispatch.put(this, "Filter", Criteria);
|
||||
}
|
||||
|
||||
public int getPageCount()
|
||||
{
|
||||
return Dispatch.get(this, "PageCount").toInt();
|
||||
}
|
||||
|
||||
public int getPageSize()
|
||||
{
|
||||
return Dispatch.get(this, "PageSize").toInt();
|
||||
}
|
||||
|
||||
public void setPageSize(int pl)
|
||||
{
|
||||
Dispatch.put(this, "PageSize", new Variant(pl));
|
||||
}
|
||||
|
||||
public String getSort()
|
||||
{
|
||||
return Dispatch.get(this, "Sort").toString();
|
||||
}
|
||||
|
||||
public void setSort(String Criteria)
|
||||
{
|
||||
Dispatch.put(this, "Sort", Criteria);
|
||||
}
|
||||
|
||||
public int getStatus()
|
||||
{
|
||||
return Dispatch.get(this, "Status").toInt();
|
||||
}
|
||||
|
||||
public int getState()
|
||||
{
|
||||
return Dispatch.get(this, "State").toInt();
|
||||
}
|
||||
|
||||
public void UpdateBatch(int AffectRecords)
|
||||
{
|
||||
Dispatch.call(this, "UpdateBatch", new Variant(AffectRecords));
|
||||
}
|
||||
|
||||
public void CancelBatch(int AffectRecords)
|
||||
{
|
||||
Dispatch.call(this, "CancelBatch", new Variant(AffectRecords));
|
||||
}
|
||||
|
||||
public int getCursorLocation()
|
||||
{
|
||||
return Dispatch.get(this, "CursorLocation").toInt();
|
||||
}
|
||||
|
||||
public void setCursorLocation(int pl)
|
||||
{
|
||||
Dispatch.put(this, "CursorLocation", new Variant(pl));
|
||||
}
|
||||
|
||||
public Recordset NextRecordset(Variant RecordsAffected)
|
||||
{
|
||||
return new Recordset(Dispatch.call(this, "NextRecordset", RecordsAffected).toDispatch());
|
||||
}
|
||||
|
||||
public boolean Supports(int CursorOptions)
|
||||
{
|
||||
return Dispatch.call(this, "Supports", new Variant(CursorOptions)).toBoolean();
|
||||
}
|
||||
|
||||
public Variant getCollect(Variant Index)
|
||||
{
|
||||
return Dispatch.get(this, "Collect");
|
||||
}
|
||||
|
||||
public void setCollect(Variant Index, Variant pvar)
|
||||
{
|
||||
Dispatch.call(this, "Collect", Index, pvar);
|
||||
}
|
||||
|
||||
public int getMarshalOptions()
|
||||
{
|
||||
return Dispatch.get(this, "MarshalOptions").toInt();
|
||||
}
|
||||
|
||||
public void setMarshalOptions(int pl)
|
||||
{
|
||||
Dispatch.put(this, "MarshalOptions", new Variant(pl));
|
||||
}
|
||||
|
||||
public void Find(String Criteria, int SkipRecords, int SearchDirection, Variant Start)
|
||||
{
|
||||
Dispatch.call(this, "Find", Criteria, new Variant(SkipRecords), new Variant(SearchDirection), Start);
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
Dispatch.call(this, "Cancel");
|
||||
}
|
||||
|
||||
public Variant getDataSource()
|
||||
{
|
||||
return Dispatch.get(this, "DataSource");
|
||||
}
|
||||
|
||||
public void setDataSource(Variant ppunkDataSource)
|
||||
{
|
||||
Dispatch.put(this, "DataSource", ppunkDataSource);
|
||||
}
|
||||
|
||||
public void Save(String FileName, int PersistFormat)
|
||||
{
|
||||
Dispatch.call(this, "Save", FileName, new Variant(PersistFormat));
|
||||
}
|
||||
|
||||
public Variant getActiveCommand()
|
||||
{
|
||||
return Dispatch.get(this, "ActiveCommand");
|
||||
}
|
||||
|
||||
public void setStayInSync(boolean pb)
|
||||
{
|
||||
Dispatch.put(this, "StayInSync", new Variant(pb));
|
||||
}
|
||||
|
||||
public boolean getStayInSync()
|
||||
{
|
||||
return Dispatch.get(this, "StayInSync").toBoolean();
|
||||
}
|
||||
|
||||
public String GetString(int StringFormat, int NumRows, String ColumnDelimeter, String RowDelimeter, String NullExpr)
|
||||
{
|
||||
return Dispatch.call(this, "GetString", new Variant(StringFormat),
|
||||
new Variant(NumRows), ColumnDelimeter, RowDelimeter, NullExpr).toString();
|
||||
}
|
||||
|
||||
public String getDataMember()
|
||||
{
|
||||
return Dispatch.get(this, "DataMember").toString();
|
||||
}
|
||||
|
||||
public void setDataMember(String pl)
|
||||
{
|
||||
Dispatch.put(this, "DataMember", new Variant(pl));
|
||||
}
|
||||
|
||||
public int CompareBookmarks(Variant Bookmark1, Variant Bookmark2)
|
||||
{
|
||||
return Dispatch.call(this, "CompareBookmarks", Bookmark1, Bookmark2).toInt();
|
||||
}
|
||||
|
||||
public Recordset Clone(int LockType)
|
||||
{
|
||||
return new Recordset(Dispatch.call(this, "Clone",
|
||||
new Variant(LockType)).toDispatch());
|
||||
}
|
||||
|
||||
public void Resync(int AffectRecords, int ResyncValues)
|
||||
{
|
||||
Dispatch.call(this, "Resync", new Variant(AffectRecords), new Variant(ResyncValues));
|
||||
}
|
||||
|
||||
public void Seek(Variant KeyValues, int SeekOption)
|
||||
{
|
||||
Dispatch.call(this, "Seek", KeyValues, new Variant(SeekOption));
|
||||
}
|
||||
|
||||
public void setIndex(String pl)
|
||||
{
|
||||
Dispatch.put(this, "Index", new Variant(pl));
|
||||
}
|
||||
|
||||
public String getIndex()
|
||||
{
|
||||
return Dispatch.get(this, "Index)").toString();
|
||||
}
|
||||
}
|
||||
package samples.ado;
|
||||
import com.jacob.com.*;
|
||||
|
||||
public class Recordset extends Dispatch
|
||||
{
|
||||
public Recordset()
|
||||
{
|
||||
super("ADODB.Recordset");
|
||||
}
|
||||
|
||||
/**
|
||||
* This constructor is used instead of a case operation to
|
||||
* turn a Dispatch object into a wider object - it must exist
|
||||
* in every wrapper class whose instances may be returned from
|
||||
* method calls wrapped in VT_DISPATCH Variants.
|
||||
*/
|
||||
public Recordset(Dispatch d)
|
||||
{
|
||||
// take over the IDispatch pointer
|
||||
m_pDispatch = d.m_pDispatch;
|
||||
// null out the input's pointer
|
||||
d.m_pDispatch = 0;
|
||||
}
|
||||
|
||||
public Variant getProperties()
|
||||
{
|
||||
return Dispatch.get(this, "Properties");
|
||||
}
|
||||
|
||||
public int getAbsolutePosition()
|
||||
{
|
||||
return Dispatch.get(this, "AbsolutePosition").toInt();
|
||||
}
|
||||
|
||||
public void setAbsolutePosition(int pl)
|
||||
{
|
||||
Dispatch.put(this, "AbsolutePosition", new Variant(pl));
|
||||
}
|
||||
|
||||
public Connection getActiveConnection()
|
||||
{
|
||||
return new Connection(Dispatch.get(this, "ActiveConnection").toDispatch());
|
||||
}
|
||||
|
||||
public void setActiveConnection(Connection ppvObject)
|
||||
{
|
||||
Dispatch.put(this, "ActiveConnection", ppvObject);
|
||||
}
|
||||
|
||||
public void setActiveConnection(Variant ppvObject)
|
||||
{
|
||||
Dispatch.put(this, "ActiveConnection", ppvObject);
|
||||
}
|
||||
|
||||
public boolean getBOF()
|
||||
{
|
||||
return Dispatch.get(this, "BOF").toBoolean();
|
||||
}
|
||||
|
||||
public Variant getBookmark()
|
||||
{
|
||||
return Dispatch.get(this, "Bookmark");
|
||||
}
|
||||
|
||||
public void setBookmark(Variant pvBookmark)
|
||||
{
|
||||
Dispatch.put(this, "Bookmark", pvBookmark);
|
||||
}
|
||||
|
||||
public int getCacheSize()
|
||||
{
|
||||
return Dispatch.get(this, "CacheSize").toInt();
|
||||
}
|
||||
|
||||
public void setCacheSize(int pl)
|
||||
{
|
||||
Dispatch.put(this, "CacheSize", new Variant(pl));
|
||||
}
|
||||
|
||||
public int getCursorType()
|
||||
{
|
||||
return Dispatch.get(this, "CursorType").toInt();
|
||||
}
|
||||
|
||||
public void setCursorType(int pl)
|
||||
{
|
||||
Dispatch.put(this, "CursorType", new Variant(pl));
|
||||
}
|
||||
|
||||
public boolean getEOF()
|
||||
{
|
||||
return Dispatch.get(this, "EOF").toBoolean();
|
||||
}
|
||||
|
||||
public Fields getFields()
|
||||
{
|
||||
return new Fields(Dispatch.get(this, "Fields").toDispatch());
|
||||
}
|
||||
|
||||
public int getLockType()
|
||||
{
|
||||
return Dispatch.get(this, "LockType").toInt();
|
||||
}
|
||||
|
||||
public void setLockType(int plLockType)
|
||||
{
|
||||
Dispatch.put(this, "LockType", new Variant(plLockType));
|
||||
}
|
||||
|
||||
public int getMaxRecords()
|
||||
{
|
||||
return Dispatch.get(this, "MaxRecords").toInt();
|
||||
}
|
||||
|
||||
public void setMaxRecords(int pl)
|
||||
{
|
||||
Dispatch.put(this, "MaxRecords", new Variant(pl));
|
||||
}
|
||||
|
||||
public int getRecordCount()
|
||||
{
|
||||
return Dispatch.get(this, "RecordCount").toInt();
|
||||
}
|
||||
|
||||
public void setSource(Object pvSource)
|
||||
{
|
||||
Dispatch.put(this, "Source", pvSource);
|
||||
}
|
||||
|
||||
public void setSource(String pvSource)
|
||||
{
|
||||
Dispatch.put(this, "Source", pvSource);
|
||||
}
|
||||
|
||||
public Variant getSource()
|
||||
{
|
||||
return Dispatch.get(this, "Source");
|
||||
}
|
||||
|
||||
public void AddNew(Variant FieldList, Variant Values)
|
||||
{
|
||||
Dispatch.call(this, "AddNew", FieldList, Values);
|
||||
}
|
||||
|
||||
public void CancelUpdate()
|
||||
{
|
||||
Dispatch.call(this, "CancelUpdate");
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Dispatch.call(this, "Close");
|
||||
}
|
||||
|
||||
public void Delete(int AffectRecords)
|
||||
{
|
||||
Dispatch.call(this, "Delete", new Variant(AffectRecords));
|
||||
}
|
||||
|
||||
public Variant GetRows(int Rows, Variant Start, Variant Fields)
|
||||
{
|
||||
return Dispatch.call(this, "GetRows", new Variant(Rows), Start, Fields);
|
||||
}
|
||||
|
||||
// get all rows
|
||||
public Variant GetRows()
|
||||
{
|
||||
return Dispatch.call(this, "GetRows");
|
||||
}
|
||||
|
||||
public void Move(int NumRecords, Variant Start)
|
||||
{
|
||||
Dispatch.call(this, "Move", new Variant(NumRecords), Start);
|
||||
}
|
||||
|
||||
public void MoveNext()
|
||||
{
|
||||
Dispatch.call(this, "MoveNext");
|
||||
}
|
||||
|
||||
public void MovePrevious()
|
||||
{
|
||||
Dispatch.call(this, "MovePrevious");
|
||||
}
|
||||
|
||||
public void MoveFirst()
|
||||
{
|
||||
Dispatch.call(this, "MoveFirst");
|
||||
}
|
||||
|
||||
public void MoveLast()
|
||||
{
|
||||
Dispatch.call(this, "MoveLast");
|
||||
}
|
||||
|
||||
public void Open(Variant Source, Variant ActiveConnection, int CursorType, int LockType, int Options)
|
||||
{
|
||||
Dispatch.call(this, "Open", Source, ActiveConnection, new Variant(CursorType), new Variant(LockType), new Variant(Options));
|
||||
}
|
||||
|
||||
public void Open(Variant Source, Variant ActiveConnection)
|
||||
{
|
||||
Dispatch.call(this, "Open", Source, ActiveConnection);
|
||||
}
|
||||
|
||||
public void Requery(int Options)
|
||||
{
|
||||
Dispatch.call(this, "Requery", new Variant(Options));
|
||||
}
|
||||
|
||||
public void Update(Variant Fields, Variant Values)
|
||||
{
|
||||
Dispatch.call(this, "Update", Fields, Values);
|
||||
}
|
||||
|
||||
public int getAbsolutePage()
|
||||
{
|
||||
return Dispatch.get(this, "AbsolutePage").toInt();
|
||||
}
|
||||
|
||||
public void setAbsolutePage(int pl)
|
||||
{
|
||||
Dispatch.put(this, "AbsolutePage", new Variant(pl));
|
||||
}
|
||||
|
||||
public int getEditMode()
|
||||
{
|
||||
return Dispatch.get(this, "EditMode").toInt();
|
||||
}
|
||||
|
||||
public Variant getFilter()
|
||||
{
|
||||
return Dispatch.get(this, "Filter");
|
||||
}
|
||||
|
||||
public void setFilter(Variant Criteria)
|
||||
{
|
||||
Dispatch.put(this, "Filter", Criteria);
|
||||
}
|
||||
|
||||
public int getPageCount()
|
||||
{
|
||||
return Dispatch.get(this, "PageCount").toInt();
|
||||
}
|
||||
|
||||
public int getPageSize()
|
||||
{
|
||||
return Dispatch.get(this, "PageSize").toInt();
|
||||
}
|
||||
|
||||
public void setPageSize(int pl)
|
||||
{
|
||||
Dispatch.put(this, "PageSize", new Variant(pl));
|
||||
}
|
||||
|
||||
public String getSort()
|
||||
{
|
||||
return Dispatch.get(this, "Sort").toString();
|
||||
}
|
||||
|
||||
public void setSort(String Criteria)
|
||||
{
|
||||
Dispatch.put(this, "Sort", Criteria);
|
||||
}
|
||||
|
||||
public int getStatus()
|
||||
{
|
||||
return Dispatch.get(this, "Status").toInt();
|
||||
}
|
||||
|
||||
public int getState()
|
||||
{
|
||||
return Dispatch.get(this, "State").toInt();
|
||||
}
|
||||
|
||||
public void UpdateBatch(int AffectRecords)
|
||||
{
|
||||
Dispatch.call(this, "UpdateBatch", new Variant(AffectRecords));
|
||||
}
|
||||
|
||||
public void CancelBatch(int AffectRecords)
|
||||
{
|
||||
Dispatch.call(this, "CancelBatch", new Variant(AffectRecords));
|
||||
}
|
||||
|
||||
public int getCursorLocation()
|
||||
{
|
||||
return Dispatch.get(this, "CursorLocation").toInt();
|
||||
}
|
||||
|
||||
public void setCursorLocation(int pl)
|
||||
{
|
||||
Dispatch.put(this, "CursorLocation", new Variant(pl));
|
||||
}
|
||||
|
||||
public Recordset NextRecordset(Variant RecordsAffected)
|
||||
{
|
||||
return new Recordset(Dispatch.call(this, "NextRecordset", RecordsAffected).toDispatch());
|
||||
}
|
||||
|
||||
public boolean Supports(int CursorOptions)
|
||||
{
|
||||
return Dispatch.call(this, "Supports", new Variant(CursorOptions)).toBoolean();
|
||||
}
|
||||
|
||||
public Variant getCollect(Variant Index)
|
||||
{
|
||||
return Dispatch.get(this, "Collect");
|
||||
}
|
||||
|
||||
public void setCollect(Variant Index, Variant pvar)
|
||||
{
|
||||
Dispatch.call(this, "Collect", Index, pvar);
|
||||
}
|
||||
|
||||
public int getMarshalOptions()
|
||||
{
|
||||
return Dispatch.get(this, "MarshalOptions").toInt();
|
||||
}
|
||||
|
||||
public void setMarshalOptions(int pl)
|
||||
{
|
||||
Dispatch.put(this, "MarshalOptions", new Variant(pl));
|
||||
}
|
||||
|
||||
public void Find(String Criteria, int SkipRecords, int SearchDirection, Variant Start)
|
||||
{
|
||||
Dispatch.call(this, "Find", Criteria, new Variant(SkipRecords), new Variant(SearchDirection), Start);
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
Dispatch.call(this, "Cancel");
|
||||
}
|
||||
|
||||
public Variant getDataSource()
|
||||
{
|
||||
return Dispatch.get(this, "DataSource");
|
||||
}
|
||||
|
||||
public void setDataSource(Variant ppunkDataSource)
|
||||
{
|
||||
Dispatch.put(this, "DataSource", ppunkDataSource);
|
||||
}
|
||||
|
||||
public void Save(String FileName, int PersistFormat)
|
||||
{
|
||||
Dispatch.call(this, "Save", FileName, new Variant(PersistFormat));
|
||||
}
|
||||
|
||||
public Variant getActiveCommand()
|
||||
{
|
||||
return Dispatch.get(this, "ActiveCommand");
|
||||
}
|
||||
|
||||
public void setStayInSync(boolean pb)
|
||||
{
|
||||
Dispatch.put(this, "StayInSync", new Variant(pb));
|
||||
}
|
||||
|
||||
public boolean getStayInSync()
|
||||
{
|
||||
return Dispatch.get(this, "StayInSync").toBoolean();
|
||||
}
|
||||
|
||||
public String GetString(int StringFormat, int NumRows, String ColumnDelimeter, String RowDelimeter, String NullExpr)
|
||||
{
|
||||
return Dispatch.call(this, "GetString", new Variant(StringFormat),
|
||||
new Variant(NumRows), ColumnDelimeter, RowDelimeter, NullExpr).toString();
|
||||
}
|
||||
|
||||
public String getDataMember()
|
||||
{
|
||||
return Dispatch.get(this, "DataMember").toString();
|
||||
}
|
||||
|
||||
public void setDataMember(String pl)
|
||||
{
|
||||
Dispatch.put(this, "DataMember", new Variant(pl));
|
||||
}
|
||||
|
||||
public int CompareBookmarks(Variant Bookmark1, Variant Bookmark2)
|
||||
{
|
||||
return Dispatch.call(this, "CompareBookmarks", Bookmark1, Bookmark2).toInt();
|
||||
}
|
||||
|
||||
public Recordset Clone(int LockType)
|
||||
{
|
||||
return new Recordset(Dispatch.call(this, "Clone",
|
||||
new Variant(LockType)).toDispatch());
|
||||
}
|
||||
|
||||
public void Resync(int AffectRecords, int ResyncValues)
|
||||
{
|
||||
Dispatch.call(this, "Resync", new Variant(AffectRecords), new Variant(ResyncValues));
|
||||
}
|
||||
|
||||
public void Seek(Variant KeyValues, int SeekOption)
|
||||
{
|
||||
Dispatch.call(this, "Seek", KeyValues, new Variant(SeekOption));
|
||||
}
|
||||
|
||||
public void setIndex(String pl)
|
||||
{
|
||||
Dispatch.put(this, "Index", new Variant(pl));
|
||||
}
|
||||
|
||||
public String getIndex()
|
||||
{
|
||||
return Dispatch.get(this, "Index)").toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
This is the WFC equivalent of the JACOB ADO example.
|
||||
|
||||
This code must be compiled with JVC and run with JVIEW.
|
||||
9
samples/ado/ms/README.txt
Normal file
9
samples/ado/ms/README.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
This is the WFC equivalent of the JACOB ADO example.
|
||||
|
||||
This code must be compiled with JVC and run with JVIEW.
|
||||
|
||||
The file testms.java has been renamed to tesetms.java.txt
|
||||
because most folks building this application will
|
||||
not have the MS JVM installed and will get compiler
|
||||
warnings. The MS JVM is going away eventually
|
||||
so this whole test will eventually go away.
|
||||
@@ -1,64 +1,66 @@
|
||||
import com.ms.com.*;
|
||||
import com.ms.wfc.data.*;
|
||||
|
||||
// an ms-only version of test.java
|
||||
public class testms
|
||||
{
|
||||
public static void printRS(Recordset rs)
|
||||
{
|
||||
Fields fs = rs.getFields();
|
||||
|
||||
for (int i=0;i<fs.getCount();i++)
|
||||
{
|
||||
System.out.print(fs.getItem(i).getName() + " ");
|
||||
}
|
||||
System.out.println("");
|
||||
|
||||
rs.moveFirst();
|
||||
while (!rs.getEOF())
|
||||
{
|
||||
for(int i=0;i<fs.getCount();i++)
|
||||
{
|
||||
Field f = fs.getItem(i);
|
||||
Variant v = f.getValue();
|
||||
System.out.print(v + " ");
|
||||
}
|
||||
System.out.println("");
|
||||
rs.moveNext();
|
||||
}
|
||||
}
|
||||
|
||||
// open a recordset directly
|
||||
public static void getRS(String con, String query)
|
||||
{
|
||||
System.out.println("Recordset Open");
|
||||
Recordset rs = new Recordset();
|
||||
rs.open(new Variant(query), new Variant(con));
|
||||
printRS(rs);
|
||||
}
|
||||
|
||||
// create connection and command objects and use them
|
||||
// to get a recordset
|
||||
public static void getCommand(String con, String query)
|
||||
{
|
||||
System.out.println("Command+Connection -> Recordset");
|
||||
Connection c = new Connection();
|
||||
c.setConnectionString(con);
|
||||
c.open();
|
||||
Command comm = new Command();
|
||||
comm.setActiveConnection(c);
|
||||
comm.setCommandType(AdoEnums.CommandType.TEXT);
|
||||
comm.setCommandText(query);
|
||||
Recordset rs = comm.execute();
|
||||
printRS(rs);
|
||||
c.close();
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
String connectStr = "DRIVER=SQL Server;SERVER=DANADLER;UID=sa;PWD=;WSID=DANADLER;DATABASE=pubs";
|
||||
String queryStr = "select * from authors";
|
||||
getCommand(connectStr, queryStr);
|
||||
getRS(connectStr, queryStr);
|
||||
}
|
||||
}
|
||||
package samples.ado.ms;
|
||||
|
||||
import com.ms.com.*;
|
||||
import com.ms.wfc.data.*;
|
||||
|
||||
// an ms-only version of test.java
|
||||
public class testms
|
||||
{
|
||||
public static void printRS(Recordset rs)
|
||||
{
|
||||
Fields fs = rs.getFields();
|
||||
|
||||
for (int i=0;i<fs.getCount();i++)
|
||||
{
|
||||
System.out.print(fs.getItem(i).getName() + " ");
|
||||
}
|
||||
System.out.println("");
|
||||
|
||||
rs.moveFirst();
|
||||
while (!rs.getEOF())
|
||||
{
|
||||
for(int i=0;i<fs.getCount();i++)
|
||||
{
|
||||
Field f = fs.getItem(i);
|
||||
Variant v = f.getValue();
|
||||
System.out.print(v + " ");
|
||||
}
|
||||
System.out.println("");
|
||||
rs.moveNext();
|
||||
}
|
||||
}
|
||||
|
||||
// open a recordset directly
|
||||
public static void getRS(String con, String query)
|
||||
{
|
||||
System.out.println("Recordset Open");
|
||||
Recordset rs = new Recordset();
|
||||
rs.open(new Variant(query), new Variant(con));
|
||||
printRS(rs);
|
||||
}
|
||||
|
||||
// create connection and command objects and use them
|
||||
// to get a recordset
|
||||
public static void getCommand(String con, String query)
|
||||
{
|
||||
System.out.println("Command+Connection -> Recordset");
|
||||
Connection c = new Connection();
|
||||
c.setConnectionString(con);
|
||||
c.open();
|
||||
Command comm = new Command();
|
||||
comm.setActiveConnection(c);
|
||||
comm.setCommandType(AdoEnums.CommandType.TEXT);
|
||||
comm.setCommandText(query);
|
||||
Recordset rs = comm.execute();
|
||||
printRS(rs);
|
||||
c.close();
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
String connectStr = "DRIVER=SQL Server;SERVER=DANADLER;UID=sa;PWD=;WSID=DANADLER;DATABASE=pubs";
|
||||
String queryStr = "select * from authors";
|
||||
getCommand(connectStr, queryStr);
|
||||
getRS(connectStr, queryStr);
|
||||
}
|
||||
}
|
||||
@@ -1,62 +1,63 @@
|
||||
import com.jacob.com.*;
|
||||
|
||||
public class test
|
||||
{
|
||||
public static void printRS(Recordset rs)
|
||||
{
|
||||
Fields fs = rs.getFields();
|
||||
|
||||
for (int i=0;i<fs.getCount();i++)
|
||||
{
|
||||
System.out.print(fs.getItem(i).getName() + " ");
|
||||
}
|
||||
System.out.println("");
|
||||
|
||||
rs.MoveFirst();
|
||||
while (!rs.getEOF())
|
||||
{
|
||||
for(int i=0;i<fs.getCount();i++)
|
||||
{
|
||||
Field f = fs.getItem(i);
|
||||
Variant v = f.getValue();
|
||||
System.out.print(v + " ");
|
||||
}
|
||||
System.out.println("");
|
||||
rs.MoveNext();
|
||||
}
|
||||
}
|
||||
|
||||
// open a recordset directly
|
||||
public static void getRS(String con, String query)
|
||||
{
|
||||
System.out.println("Recordset Open");
|
||||
Recordset rs = new Recordset();
|
||||
rs.Open(new Variant(query), new Variant(con));
|
||||
printRS(rs);
|
||||
}
|
||||
|
||||
// create connection and command objects and use them
|
||||
// to get a recordset
|
||||
public static void getCommand(String con, String query)
|
||||
{
|
||||
System.out.println("Command+Connection -> Recordset");
|
||||
Connection c = new Connection();
|
||||
c.setConnectionString(con);
|
||||
c.Open();
|
||||
Command comm = new Command();
|
||||
comm.setActiveConnection(c);
|
||||
comm.setCommandType(CommandTypeEnum.adCmdText);
|
||||
comm.setCommandText(query);
|
||||
Recordset rs = comm.Execute();
|
||||
printRS(rs);
|
||||
c.Close();
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
String connectStr = "DRIVER=SQL Server;SERVER=DANADLER;UID=sa;PWD=;WSID=DANADLER;DATABASE=pubs";
|
||||
String queryStr = "select * from authors";
|
||||
getCommand(connectStr, queryStr);
|
||||
getRS(connectStr, queryStr);
|
||||
}
|
||||
}
|
||||
package samples.ado;
|
||||
import com.jacob.com.*;
|
||||
|
||||
public class test
|
||||
{
|
||||
public static void printRS(Recordset rs)
|
||||
{
|
||||
Fields fs = rs.getFields();
|
||||
|
||||
for (int i=0;i<fs.getCount();i++)
|
||||
{
|
||||
System.out.print(fs.getItem(i).getName() + " ");
|
||||
}
|
||||
System.out.println("");
|
||||
|
||||
rs.MoveFirst();
|
||||
while (!rs.getEOF())
|
||||
{
|
||||
for(int i=0;i<fs.getCount();i++)
|
||||
{
|
||||
Field f = fs.getItem(i);
|
||||
Variant v = f.getValue();
|
||||
System.out.print(v + " ");
|
||||
}
|
||||
System.out.println("");
|
||||
rs.MoveNext();
|
||||
}
|
||||
}
|
||||
|
||||
// open a recordset directly
|
||||
public static void getRS(String con, String query)
|
||||
{
|
||||
System.out.println("Recordset Open");
|
||||
Recordset rs = new Recordset();
|
||||
rs.Open(new Variant(query), new Variant(con));
|
||||
printRS(rs);
|
||||
}
|
||||
|
||||
// create connection and command objects and use them
|
||||
// to get a recordset
|
||||
public static void getCommand(String con, String query)
|
||||
{
|
||||
System.out.println("Command+Connection -> Recordset");
|
||||
Connection c = new Connection();
|
||||
c.setConnectionString(con);
|
||||
c.Open();
|
||||
Command comm = new Command();
|
||||
comm.setActiveConnection(c);
|
||||
comm.setCommandType(CommandTypeEnum.adCmdText);
|
||||
comm.setCommandText(query);
|
||||
Recordset rs = comm.Execute();
|
||||
printRS(rs);
|
||||
c.Close();
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
String connectStr = "DRIVER=SQL Server;SERVER=DANADLER;UID=sa;PWD=;WSID=DANADLER;DATABASE=pubs";
|
||||
String queryStr = "select * from authors";
|
||||
getCommand(connectStr, queryStr);
|
||||
getRS(connectStr, queryStr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +1,49 @@
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.applet.*;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
public class AppTest extends Applet implements ActionListener
|
||||
{
|
||||
TextField in;
|
||||
TextField out;
|
||||
Button calc;
|
||||
ActiveXComponent sC = null;
|
||||
Object sControl = null;
|
||||
|
||||
public void init()
|
||||
{
|
||||
setLayout(new FlowLayout());
|
||||
add(in = new TextField("1+1", 16));
|
||||
add(out = new TextField("?", 16));
|
||||
add(calc = new Button("Calculate"));
|
||||
calc.addActionListener(this);
|
||||
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent ev)
|
||||
{
|
||||
if (sC == null) {
|
||||
String lang = "VBScript";
|
||||
sC = new ActiveXComponent("ScriptControl");
|
||||
sControl = sC.getObject();
|
||||
Dispatch.put(sControl, "Language", lang);
|
||||
}
|
||||
Variant v = Dispatch.call(sControl, "Eval", in.getText());
|
||||
out.setText(v.toString());
|
||||
}
|
||||
}
|
||||
package samples.applet;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.applet.*;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
/**
|
||||
* Applet test case
|
||||
*/
|
||||
public class AppTest extends Applet implements ActionListener
|
||||
{
|
||||
TextField in;
|
||||
TextField out;
|
||||
Button calc;
|
||||
ActiveXComponent sC = null;
|
||||
Object sControl = null;
|
||||
|
||||
/**
|
||||
* startup method
|
||||
*/
|
||||
public void init()
|
||||
{
|
||||
setLayout(new FlowLayout());
|
||||
add(in = new TextField("1+1", 16));
|
||||
add(out = new TextField("?", 16));
|
||||
add(calc = new Button("Calculate"));
|
||||
calc.addActionListener(this);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* action method that receives button actions
|
||||
* @param ev the event
|
||||
*/
|
||||
public void actionPerformed(ActionEvent ev)
|
||||
{
|
||||
if (sC == null) {
|
||||
String lang = "VBScript";
|
||||
sC = new ActiveXComponent("ScriptControl");
|
||||
sControl = sC.getObject();
|
||||
Dispatch.put(sControl, "Language", lang);
|
||||
}
|
||||
Variant v = Dispatch.call(sControl, "Eval", in.getText());
|
||||
out.setText(v.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,73 +1,75 @@
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.io.*;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
public class JacobScript extends javax.servlet.http.HttpServlet
|
||||
{
|
||||
public void doGet(HttpServletRequest req,
|
||||
HttpServletResponse res)
|
||||
throws ServletException
|
||||
{
|
||||
PrintWriter out = null;
|
||||
try
|
||||
{
|
||||
res.setContentType("text/html");
|
||||
out = res.getWriter();
|
||||
// display a form
|
||||
out.println("<h1>Enter a VBScript Expression</h1>");
|
||||
out.println("<form method=\"POST\" action=\"/JacobScript\">");
|
||||
out.println("<input name=\"expr\" type=\"text\" width=64>");
|
||||
out.println("<input type=\"submit\">");
|
||||
out.println("</form>");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
out.println("<H2>Error:"+e+"</H2>");
|
||||
}
|
||||
}
|
||||
|
||||
public void doPost(HttpServletRequest req,
|
||||
HttpServletResponse res)
|
||||
throws ServletException
|
||||
{
|
||||
PrintWriter out = null;
|
||||
|
||||
try
|
||||
{
|
||||
res.setContentType("text/html");
|
||||
out = res.getWriter();
|
||||
// get what they typed in
|
||||
String expr = (String)req.getParameter("expr");
|
||||
// make sure we have a session
|
||||
HttpSession session = req.getSession(true);
|
||||
Object sControl = null;
|
||||
if (session.isNew())
|
||||
{
|
||||
// initialize the control and store it on the session
|
||||
String lang = "VBScript";
|
||||
ActiveXComponent sC = new ActiveXComponent("ScriptControl");
|
||||
sControl = sC.getObject();
|
||||
Dispatch.put(sControl, "Language", lang);
|
||||
session.putValue("control", sControl);
|
||||
}
|
||||
else
|
||||
{
|
||||
sControl = session.getValue("control");
|
||||
}
|
||||
Variant result = Dispatch.call(sControl, "Eval", expr);
|
||||
// display a form
|
||||
out.println("<h1>Enter a VBScript Expression</h1>");
|
||||
out.println("<form method=\"POST\" action=\"/JacobScript\">");
|
||||
out.println("<input name=\"expr\" type=\"text\" value=\""+expr+"\" width=64>");
|
||||
out.println("<input type=\"submit\">");
|
||||
out.println("</form>");
|
||||
out.println("<H1>Jacob Response:</H1>");
|
||||
out.println("<H2>"+result+"</H2>");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
out.println("<H2>Error:"+e+"</H2>");
|
||||
}
|
||||
}
|
||||
}
|
||||
package samples.servlet;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.io.*;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
public class JacobScript extends javax.servlet.http.HttpServlet
|
||||
{
|
||||
public void doGet(HttpServletRequest req,
|
||||
HttpServletResponse res)
|
||||
throws ServletException
|
||||
{
|
||||
PrintWriter out = null;
|
||||
try
|
||||
{
|
||||
res.setContentType("text/html");
|
||||
out = res.getWriter();
|
||||
// display a form
|
||||
out.println("<h1>Enter a VBScript Expression</h1>");
|
||||
out.println("<form method=\"POST\" action=\"/JacobScript\">");
|
||||
out.println("<input name=\"expr\" type=\"text\" width=64>");
|
||||
out.println("<input type=\"submit\">");
|
||||
out.println("</form>");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
out.println("<H2>Error:"+e+"</H2>");
|
||||
}
|
||||
}
|
||||
|
||||
public void doPost(HttpServletRequest req,
|
||||
HttpServletResponse res)
|
||||
throws ServletException
|
||||
{
|
||||
PrintWriter out = null;
|
||||
|
||||
try
|
||||
{
|
||||
res.setContentType("text/html");
|
||||
out = res.getWriter();
|
||||
// get what they typed in
|
||||
String expr = (String)req.getParameter("expr");
|
||||
// make sure we have a session
|
||||
HttpSession session = req.getSession(true);
|
||||
Object sControl = null;
|
||||
if (session.isNew())
|
||||
{
|
||||
// initialize the control and store it on the session
|
||||
String lang = "VBScript";
|
||||
ActiveXComponent sC = new ActiveXComponent("ScriptControl");
|
||||
sControl = sC.getObject();
|
||||
Dispatch.put(sControl, "Language", lang);
|
||||
session.putValue("control", sControl);
|
||||
}
|
||||
else
|
||||
{
|
||||
sControl = session.getValue("control");
|
||||
}
|
||||
Variant result = Dispatch.call(sControl, "Eval", expr);
|
||||
// display a form
|
||||
out.println("<h1>Enter a VBScript Expression</h1>");
|
||||
out.println("<form method=\"POST\" action=\"/JacobScript\">");
|
||||
out.println("<input name=\"expr\" type=\"text\" value=\""+expr+"\" width=64>");
|
||||
out.println("<input type=\"submit\">");
|
||||
out.println("</form>");
|
||||
out.println("<H1>Jacob Response:</H1>");
|
||||
out.println("<H2>"+result+"</H2>");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
out.println("<H2>Error:"+e+"</H2>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,89 +1,110 @@
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
class Access
|
||||
{
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
ComThread.InitSTA();
|
||||
ActiveXComponent ax = new ActiveXComponent("DAO.PrivateDBEngine");
|
||||
// this only works for access files pre-access-2000
|
||||
Dispatch db = open(ax, ".\\sample2.mdb");
|
||||
String sql = "select * from MainTable";
|
||||
// make a temporary querydef
|
||||
Dispatch qd = Dispatch.call(db, "CreateQueryDef","").toDispatch();
|
||||
// set the SQL string on it
|
||||
Dispatch.put(qd, "SQL", sql);
|
||||
Variant result = getByQueryDef(qd);
|
||||
// the 2-d safearray is transposed from what you might expect
|
||||
System.out.println(result.toSafeArray());
|
||||
close(db);
|
||||
ComThread.Release();
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a database
|
||||
*/
|
||||
public static Dispatch open(ActiveXComponent ax, String fileName)
|
||||
{
|
||||
Variant f = new Variant(false);
|
||||
// open the file in read-only mode
|
||||
Variant[] args = new Variant[] {new Variant(fileName), f, f};
|
||||
Dispatch openDB = ax.invoke("OpenDatabase", args).toDispatch();
|
||||
return openDB;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close a database
|
||||
*/
|
||||
public static void close(Dispatch openDB)
|
||||
{
|
||||
Dispatch.call(openDB, "Close");
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract the values from the recordset
|
||||
*/
|
||||
public static Variant getValues(Dispatch recset)
|
||||
{
|
||||
Dispatch.callSub(recset,"moveFirst");
|
||||
Variant vi = new Variant(4096);
|
||||
Variant v = Dispatch.call(recset,"GetRows", vi);
|
||||
return v;
|
||||
}
|
||||
|
||||
public static Variant getByQueryDef(Dispatch qd)
|
||||
{
|
||||
// get a reference to the recordset
|
||||
Dispatch recset = Dispatch.call(qd, "OpenRecordset").toDispatch();
|
||||
// get the values as a safe array
|
||||
String[] cols = getColumns(recset);
|
||||
for(int i=0;i<cols.length;i++)
|
||||
{
|
||||
System.out.print(cols[i]+" ");
|
||||
}
|
||||
System.out.println("");
|
||||
Variant vals = getValues(recset);
|
||||
return vals;
|
||||
}
|
||||
|
||||
public static String[] getColumns(Dispatch recset)
|
||||
{
|
||||
Dispatch flds = Dispatch.get(recset, "Fields").toDispatch();
|
||||
int n_flds = Dispatch.get(flds, "Count").toInt();
|
||||
String[] s = new String[n_flds];
|
||||
Variant vi = new Variant();
|
||||
for (int i=0;i<n_flds;i++) {
|
||||
vi.putInt(i);
|
||||
// must use the invoke method because this is a method call
|
||||
// that wants to have a Dispatch.Get flag...
|
||||
Dispatch fld = Dispatch.invoke(recset, "Fields",
|
||||
Dispatch.Get, new Object[] {vi}, new int[1]).toDispatch();
|
||||
Variant name = Dispatch.get(fld, "Name");
|
||||
s[i] = name.toString();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
package samples.test;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
class Access
|
||||
{
|
||||
/**
|
||||
* the main loop for the test
|
||||
* @param args
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
ComThread.InitSTA();
|
||||
ActiveXComponent ax = new ActiveXComponent("DAO.PrivateDBEngine");
|
||||
// this only works for access files pre-access-2000
|
||||
Dispatch db = open(ax, ".\\sample2.mdb");
|
||||
String sql = "select * from MainTable";
|
||||
// make a temporary querydef
|
||||
Dispatch qd = Dispatch.call(db, "CreateQueryDef","").toDispatch();
|
||||
// set the SQL string on it
|
||||
Dispatch.put(qd, "SQL", sql);
|
||||
Variant result = getByQueryDef(qd);
|
||||
// the 2-d safearray is transposed from what you might expect
|
||||
System.out.println(result.toSafeArray());
|
||||
close(db);
|
||||
ComThread.Release();
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a database
|
||||
* @param ax
|
||||
* @param fileName
|
||||
* @return dispatch object that was opened
|
||||
*/
|
||||
public static Dispatch open(ActiveXComponent ax, String fileName)
|
||||
{
|
||||
Variant f = new Variant(false);
|
||||
// open the file in read-only mode
|
||||
Variant[] args = new Variant[] {new Variant(fileName), f, f};
|
||||
Dispatch openDB = ax.invoke("OpenDatabase", args).toDispatch();
|
||||
return openDB;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close a database
|
||||
* @param openDB db to be closed
|
||||
*/
|
||||
public static void close(Dispatch openDB)
|
||||
{
|
||||
Dispatch.call(openDB, "Close");
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract the values from the recordset
|
||||
* @param recset
|
||||
* @return Variant that is the returned values
|
||||
*/
|
||||
public static Variant getValues(Dispatch recset)
|
||||
{
|
||||
Dispatch.callSub(recset,"moveFirst");
|
||||
Variant vi = new Variant(4096);
|
||||
Variant v = Dispatch.call(recset,"GetRows", vi);
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
* should return ?? for the passed in ??
|
||||
* @param qd
|
||||
* @return Variant results of query?
|
||||
*/
|
||||
public static Variant getByQueryDef(Dispatch qd)
|
||||
{
|
||||
// get a reference to the recordset
|
||||
Dispatch recset = Dispatch.call(qd, "OpenRecordset").toDispatch();
|
||||
// get the values as a safe array
|
||||
String[] cols = getColumns(recset);
|
||||
for(int i=0;i<cols.length;i++)
|
||||
{
|
||||
System.out.print(cols[i]+" ");
|
||||
}
|
||||
System.out.println("");
|
||||
Variant vals = getValues(recset);
|
||||
return vals;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the columns form the rec set
|
||||
* @param recset
|
||||
* @return list of column names
|
||||
*/
|
||||
public static String[] getColumns(Dispatch recset)
|
||||
{
|
||||
Dispatch flds = Dispatch.get(recset, "Fields").toDispatch();
|
||||
int n_flds = Dispatch.get(flds, "Count").toInt();
|
||||
String[] s = new String[n_flds];
|
||||
Variant vi = new Variant();
|
||||
for (int i=0;i<n_flds;i++) {
|
||||
vi.putInt(i);
|
||||
// must use the invoke method because this is a method call
|
||||
// that wants to have a Dispatch.Get flag...
|
||||
Dispatch fld = Dispatch.invoke(recset, "Fields",
|
||||
Dispatch.Get, new Object[] {vi}, new int[1]).toDispatch();
|
||||
Variant name = Dispatch.get(fld, "Name");
|
||||
s[i] = name.toString();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +1,34 @@
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
class MultiFace
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
System.runFinalizersOnExit(true);
|
||||
|
||||
ActiveXComponent mf = new ActiveXComponent("MultiFace.Face");
|
||||
try {
|
||||
// I am now dealing with the default interface (IFace1)
|
||||
Dispatch.put(mf, "Face1Name", new Variant("Hello Face1"));
|
||||
System.out.println(Dispatch.get(mf, "Face1Name"));
|
||||
|
||||
// get to IFace2 through the IID
|
||||
Dispatch f2 = mf.QueryInterface("{9BF24410-B2E0-11D4-A695-00104BFF3241}");
|
||||
// I am now dealing with IFace2
|
||||
Dispatch.put(f2, "Face2Nam", new Variant("Hello Face2"));
|
||||
System.out.println(Dispatch.get(f2, "Face2Nam"));
|
||||
|
||||
// get to IFace3 through the IID
|
||||
Dispatch f3 = mf.QueryInterface("{9BF24411-B2E0-11D4-A695-00104BFF3241}");
|
||||
// I am now dealing with IFace3
|
||||
Dispatch.put(f3, "Face3Name", new Variant("Hello Face3"));
|
||||
System.out.println(Dispatch.get(f3, "Face3Name"));
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
package samples.test.atl;
|
||||
|
||||
import com.jacob.com.*;
|
||||
import com.jacob.activeX.*;
|
||||
|
||||
class MultiFaceTest
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
System.runFinalizersOnExit(true);
|
||||
|
||||
ActiveXComponent mf = new ActiveXComponent("MultiFace.Face");
|
||||
try {
|
||||
// I am now dealing with the default interface (IFace1)
|
||||
Dispatch.put(mf, "Face1Name", new Variant("Hello Face1"));
|
||||
System.out.println(Dispatch.get(mf, "Face1Name"));
|
||||
|
||||
// get to IFace2 through the IID
|
||||
Dispatch f2 = mf.QueryInterface("{9BF24410-B2E0-11D4-A695-00104BFF3241}");
|
||||
// I am now dealing with IFace2
|
||||
Dispatch.put(f2, "Face2Nam", new Variant("Hello Face2"));
|
||||
System.out.println(Dispatch.get(f2, "Face2Nam"));
|
||||
|
||||
// get to IFace3 through the IID
|
||||
Dispatch f3 = mf.QueryInterface("{9BF24411-B2E0-11D4-A695-00104BFF3241}");
|
||||
// I am now dealing with IFace3
|
||||
Dispatch.put(f3, "Face3Name", new Variant("Hello Face3"));
|
||||
System.out.println(Dispatch.get(f3, "Face3Name"));
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user