例题:
http://www.delphibbs.com/delphibbs/dispq.asp?lid=3630920
例题代码:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, remotejavaconnection, DB, DBClient, RemoteJavaDataSet,
Grids, DBGrids, RemoteUpdateSql;
type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
qq: TRemoteJavaDataSet;
RJC: TRemoteJavaConnection;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button7: TButton;
RemoteUpdateSql1: TRemoteUpdateSql;
Memo1: TMemo;
Edit3: TEdit;
Label3: TLabel;
Edit4: TEdit;
Label4: TLabel;
procedure Button7Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure DataSource1DataChange(Sender: TObject;
Field: TField);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button7Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
qq.RemoteJavaConnection:=Rjc;
Rjc.RemoteIp:=edit1.Text;
Rjc.RemotePort:=strtoint(edit2.Text);
qq.PageSize:=strtoint(edit4.text);
qq.Close;
qq.SQL.Text:='select * from test';
qq.Open;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
qq.FirstPage;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
qq.PriorPage;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
qq.NextPage;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
qq.LastPage;
end;
procedure TForm1.DataSource1DataChange(Sender: TObject;
Field: TField);
begin
edit3.Text:=vartostr(qq.PageNo)+'/'+vartostr(qq.PageNum);
end;
end.