From: Olivier S. <ob...@us...> - 2004-12-20 19:36:19
|
Update of /cvsroot/jvcl/dev/JVCL3/examples/JvUIB/BCB/Blob/AsString In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3349/dev/JVCL3/examples/JvUIB/BCB/Blob/AsString Added Files: BlobSample.bpr BlobSample.cpp BlobSample.res main.cpp main.dfm main.h Log Message: New example from Korecek --- NEW FILE: main.cpp --- //--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "main.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "JvComponent" #pragma link "JvUIB" #pragma resource "*.dfm" TfrmMain *frmMain; //--------------------------------------------------------------------------- __fastcall TfrmMain::TfrmMain(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TfrmMain::goClick(TObject *Sender) { TARecord Datas[10]; /* init Datas */ for(int i=0;i<10;++i) { Datas[i].COUNTRY ="blabla"+IntToStr(i); Datas[i].CURRENCY="blabla"; } for(int i = 0;i<10;++i) { Query->Params->AsString[0] = Datas[i].COUNTRY; Query->Params->AsString[1] = Datas[i].CURRENCY; Query->Execute(); // for better performance commit every 1000 records // Transaction.Commit; } Query->Close(etmRollback); // change to etmCommit to apply. } //--------------------------------------------------------------------------- --- NEW FILE: BlobSample.bpr --- <?xml version='1.0' encoding='utf-8' ?> <!-- C++Builder XML Project --> <PROJECT> <MACROS> <VERSION value="BCB.06.00"/> <PROJECT value="..\..\..\..\..\bin\BlobSample.exe"/> <OBJFILES value="..\..\..\..\..\dcu\BlobSample.obj ..\..\..\..\..\dcu\main.obj"/> <RESFILES value="BlobSample.res"/> <IDLFILES value=""/> <IDLGENFILES value=""/> <DEFFILE value=""/> <RESDEPEN value="$(RESFILES) main.dfm"/> <LIBFILES value=""/> <LIBRARIES value=""/> <SPARELIBS value=""/> <PACKAGES value=""/> <PATHCPP value=".;"/> <PATHPAS value=".;"/> <PATHRC value=".;"/> <PATHASM value=".;"/> <DEBUGLIBPATH value="$(BCB)\lib\debug"/> <RELEASELIBPATH value="$(BCB)\lib\release"/> <LINKER value="ilink32"/> <USERDEFINES value="_DEBUG"/> <SYSDEFINES value="NO_STRICT"/> <MAINSOURCE value="BlobSample.cpp"/> <INCLUDEPATH value="$(BCB)\include;$(BCB)\include\vcl;$(includepath)"/> <LIBPATH value="$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib;$(RESPATH)"/> <WARNINGS value="-w-par"/> <OTHERFILES value=""/> </MACROS> <OPTIONS> <IDLCFLAGS value="-I$(BCB)\include -I$(BCB)\include\vcl -I$(includepath) -src_suffix cpp -D_DEBUG -boa"/> <CFLAG1 value="-Od -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi- -c -tW -tWM"/> <PFLAGS value="-N2..\..\..\..\..\dcu -N0..\..\..\..\..\dcu -$Y+ -$W -$O- -$A8 -v -JPHNE -M"/> <RFLAGS value=""/> <AFLAGS value="/mx /w2 /zi"/> <LFLAGS value="-I..\..\..\..\..\dcu -D"" -aa -Tpe -x -Gn -v"/> <OTHERFILES value=""/> </OPTIONS> <LINKER> <ALLOBJ value="c0w32.obj sysinit.obj $(OBJFILES)"/> <ALLRES value="$(RESFILES)"/> <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/> <OTHERFILES value=""/> </LINKER> <FILELIST> <FILE FILENAME="BlobSample.res" FORMNAME="" UNITNAME="BlobSample.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/> <FILE FILENAME="BlobSample.cpp" FORMNAME="" UNITNAME="BlobSample" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> <FILE FILENAME="main.cpp" FORMNAME="frmMain" UNITNAME="main" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> </FILELIST> <BUILDTOOLS> </BUILDTOOLS> <IDEOPTIONS> [Version Info] IncludeVerInfo=0 AutoIncBuild=0 MajorVer=1 MinorVer=0 Release=0 Build=0 Debug=0 PreRelease=0 Special=0 Private=0 DLL=0 Locale=1029 CodePage=1250 [Version Info Keys] CompanyName= FileDescription= FileVersion=1.0.0.0 InternalName= LegalCopyright= LegalTrademarks= OriginalFilename= ProductName= ProductVersion=1.0.0.0 Comments= [Excluded Packages] c:\prog\cbuilder6\Projects\Bpl\JvCryptC6D.bpl=JVCL Encryption and Compression Components c:\prog\cbuilder6\Projects\Bpl\JvBandsC6D.bpl=JVCL Band Objects c:\prog\cbuilder6\Projects\Bpl\JvPluginC6D.bpl=JVCL Plugin Components c:\prog\cbuilder6\Projects\Bpl\JvJansC6D.bpl=JVCL Jans Components c:\prog\cbuilder6\Projects\Bpl\JvValidatorsC6D.bpl=JVCL Validators and Error Provider Components [HistoryLists\hlIncludePath] Count=1 Item0=$(BCB)\include;$(BCB)\include\vcl;$(includepath) [HistoryLists\hlLibraryPath] Count=1 Item0=$(BCB)\Projects\Lib;$(BCB)\lib\obj;$(BCB)\lib;$(RESPATH) [HistoryLists\hlDebugSourcePath] Count=1 Item0=$(BCB)\source\vcl [HistoryLists\hlConditionals] Count=1 Item0=_DEBUG [HistoryLists\hlIntOutputDir] Count=1 Item0=..\..\..\..\..\dcu [HistoryLists\hlFinalOutputDir] Count=2 Item0=..\..\..\..\..\bin\ Item1=..\..\..\..\..\bin [Debugging] DebugSourceDirs=$(BCB)\source\vcl [Parameters] RunParams= Launcher= UseLauncher=0 DebugCWD= HostApplication= RemoteHost= RemotePath= RemoteLauncher= RemoteCWD= RemoteDebug=0 [Compiler] ShowInfoMsgs=0 LinkDebugVcl=0 LinkCGLIB=0 [CORBA] AddServerUnit=1 AddClientUnit=1 PrecompiledHeaders=1 [Language] ActiveLang= ProjectLang= RootDir= </IDEOPTIONS> </PROJECT> --- NEW FILE: main.dfm --- object frmMain: TfrmMain Left = 210 Top = 238 Width = 246 Height = 130 Caption = 'Data Pump example' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False PixelsPerInch = 96 TextHeight = 13 object go: TButton Left = 80 Top = 40 Width = 75 Height = 25 Caption = 'go' TabOrder = 0 OnClick = goClick end object DataBase: TJvUIBDataBase Params.Strings = ( 'sql_dialect=3' 'lc_ctype=NONE' 'password=masterkey' 'user_name=SYSDBA') DatabaseName = 'Data\EMPLOYEE.GDB' UserName = 'SYSDBA' PassWord = 'masterkey' LibraryName = 'gds32.dll' Left = 10 Top = 6 end object Transaction: TJvUIBTransaction DataBase = DataBase Left = 40 Top = 8 end object Query: TJvUIBQuery SQL.Strings = ( 'INSERT INTO COUNTRY (COUNTRY,CURRENCY) VALUES (?, ?)') Transaction = Transaction CachedFetch = False Left = 72 Top = 8 end end --- NEW FILE: main.h --- //--------------------------------------------------------------------------- #ifndef mainB6H #define mainB6H //--------------------------------------------------------------------------- #include <Classes.hpp> #include <Controls.hpp> #include <StdCtrls.hpp> #include <Forms.hpp> #include "JvComponent.hpp" #include "JvUIB.hpp" //--------------------------------------------------------------------------- typedef struct TADTRecord { String COUNTRY; String CURRENCY; } TARecord; class TfrmMain : public TForm { __published: // IDE-managed Components TButton *go; TJvUIBDataBase *DataBase; TJvUIBTransaction *Transaction; TJvUIBQuery *Query; void __fastcall goClick(TObject *Sender); private: // User declarations public: // User declarations __fastcall TfrmMain(TComponent* Owner); }; //--------------------------------------------------------------------------- extern PACKAGE TfrmMain *frmMain; //--------------------------------------------------------------------------- #endif --- NEW FILE: BlobSample.cpp --- //--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop //--------------------------------------------------------------------------- USEFORM("main.cpp", frmMain); //--------------------------------------------------------------------------- WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { try { Application->Initialize(); Application->CreateForm(__classid(TfrmMain), &frmMain); Application->Run(); } catch (Exception &exception) { Application->ShowException(&exception); } catch (...) { try { throw Exception(""); } catch (Exception &exception) { Application->ShowException(&exception); } } return 0; } //--------------------------------------------------------------------------- --- NEW FILE: BlobSample.res --- (This appears to be a binary file; contents omitted.) |