Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » First Firebird for U++ steps
First Firebird for U++ steps [message #16868] Fri, 18 July 2008 09:38 Go to next message
aldeacity is currently offline  aldeacity
Messages: 18
Registered: July 2008
Location: Spain
Promising Member
Hello,
as I wrote, I'm interesting in Firebird for U++. So, I've starting developping of it. No I've made basic session and connection objects. It's basic now but It works!!!!
At this moment, it connects and disconnects from databases and also begins, commits and executes querys and build columns information.
All process are transactional, so if I execute a sentence, it will be look for a transaction open in session and if there isn't it'll use a transaction for that execute process.
Now I'm working in Fetch and GetColumn functions.
I hoppe it will be useful!!
Regards,
Juan.
Re: First Firebird for U++ steps [message #16882 is a reply to message #16868] Sat, 19 July 2008 09:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Good news, thanks!

Mirek
Re: First Firebird for U++ steps [message #16904 is a reply to message #16868] Sun, 20 July 2008 11:26 Go to previous messageGo to next message
Factor is currently offline  Factor
Messages: 5
Registered: June 2007
Location: Hungary
Promising Member
Some times ago I've been working on a similar project. I've attached the two packages. It's not finished but works and maybe it can give some help. On linux you should use IBPP_LINUX instead of IBPP_WINDOWS. The decimal package contains a half made "custom" precision decimal class.
  • Attachment: FireBird.zip
    (Size: 114.80KB, Downloaded 373 times)
  • Attachment: Decimal.zip
    (Size: 4.74KB, Downloaded 596 times)
Re: First Firebird for U++ steps [message #16931 is a reply to message #16904] Mon, 21 July 2008 14:32 Go to previous messageGo to next message
aldeacity is currently offline  aldeacity
Messages: 18
Registered: July 2008
Location: Spain
Promising Member
Good work as I can see!
It's bassed on IBPP (C++). I'm writting code using only Firebird development kit, so using C interface.
Perhaps it would be better to use and complete your code and not to re-write new code as I'm doing Wink

What do you think about it?

Juan.
Re: First Firebird for U++ steps [message #16957 is a reply to message #16931] Wed, 23 July 2008 10:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
aldeacity wrote on Mon, 21 July 2008 08:32


I'm writting code using only Firebird development kit, so using C interface.



If possible, please this is what we need...

Mirek
Re: First Firebird for U++ steps [message #17079 is a reply to message #16957] Mon, 28 July 2008 10:21 Go to previous messageGo to next message
aldeacity is currently offline  aldeacity
Messages: 18
Registered: July 2008
Location: Spain
Promising Member
Hello!

I'm coding basic FireBirdSession and FireBirdConnection objects. Until now, it's possible to connect to databases and to use basic operations. All is made using only Firebird development environment without any external requeriments. I would like to inform what I've made until now to know what more basic requeriments would be good to make.
So, until now, it's possible:

- Connect/Disconnect to databases.
- Begin, Commit and Rollback transactions.
- Execute is fully implemented (and it's all transactional and also being possible to execute querys without begin/commit/trans functions).
- Columns information building with correct types and reservation for data.
- GetColumn is fully implemented (as I think Smile, perhaps blob is not so good) with an exhaustive method of control.
- GetUser is implemented.
- EnumTables is implemented.

I've tested it in Windows and today I hope to be able to test it in Linux.

I would like to know what other functions would be good to implement to be at least usable.

Also, I would like to know linking method with DLL, as in linking in IDE and on runtime.

Regards...

Juan.
Re: First Firebird for U++ steps [message #17081 is a reply to message #17079] Mon, 28 July 2008 10:49 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

BTW: I think we could after a bit refactoring adopt you decimal class for upp. It's the only missing type of Value right now IMO.
Re: First Firebird for U++ steps [message #17082 is a reply to message #17081] Mon, 28 July 2008 12:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
unodgs wrote on Mon, 28 July 2008 04:49

BTW: I think we could after a bit refactoring adopt you decimal class for upp. It's the only missing type of Value right now IMO.


I wonder whether this is implementation is a good tactics.

E.g. .NET seems to implement decimal as 128bit FP number with decimal exponent.

Mirek
Re: First Firebird for U++ steps [message #17083 is a reply to message #17082] Mon, 28 July 2008 12:35 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

luzr wrote on Mon, 28 July 2008 06:09

unodgs wrote on Mon, 28 July 2008 04:49

BTW: I think we could after a bit refactoring adopt you decimal class for upp. It's the only missing type of Value right now IMO.


I wonder whether this is implementation is a good tactics.

E.g. .NET seems to implement decimal as 128bit FP number with decimal exponent.

Mirek

Well we can start with anything. Implementation can be always changed. What I wanted only to say Decimal type would be very useful (+ plus EditDecimal, EditCurrency...)
Re: First Firebird for U++ steps [message #17088 is a reply to message #17083] Mon, 28 July 2008 14:40 Go to previous messageGo to next message
aldeacity is currently offline  aldeacity
Messages: 18
Registered: July 2008
Location: Spain
Promising Member
Hello,

I send a sample testing datagrid. All columns seem to be ok, of course expect salary column that it's decimal(10,2). I.m adapting FireBirdSchema.h now.

Database is Firebird test database (EMPLOYEE.FDB).

Query is:
SELECT EMP_NO, FIRST_NAME, LAST_NAME, SALARY, FULL_NAME FROM EMPLOYEE;

Schema is:
TABLE_(EMPLOYEE)
INT_ (EMP_NO)
STRING_ (FIRST_NAME)
STRING_ (LAST_NAME)
STRING_ (SALARY)
STRING_ (FULL_NAME)
END_TABLE

Code for datagrid is:
frmTest.grdData.SetTable(EMPLOYEE);
frmTest.grdData.AddColumn(EMP_NO, "Emp. No.");
frmTest.grdData.AddColumn(FIRST_NAME, "First Name");
frmTest.grdData.AddColumn(LAST_NAME, "Last Name");
frmTest.grdData.AddColumn(SALARY, "Salary");
frmTest.grdData.AddColumn(FULL_NAME, "Full Name");
frmTest.grdData.Query();

Juan.
  • Attachment: datagrid.zip
    (Size: 32.52KB, Downloaded 342 times)
Re: First Firebird for U++ steps [message #17114 is a reply to message #17088] Tue, 29 July 2008 16:09 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

I have refactored decimal class a bit:
decimal is now Decimal
I think you wanted braces here:
    if(sign!=d.sign) 
        if(sign>d.sign) return 1; 
        if(sign<d.sign) return -1;

This patch is also included.
I changed
memcpy(number, d.number, D_SIZE * sizeof(int));

to
memcpy(number, d.number, D_SIZE * sizeof(int32));

I also formatted code in upp way (please follow our style in your firebird plugin) and changed throw messages from uppercase to lowercase.

I'm gonna try to use this class in my app and check if it works well. I will also modify postgres plugin to be compatibile with decimal (only a try..)
  • Attachment: Decimal.7z
    (Size: 4.08KB, Downloaded 301 times)
Re: First Firebird for U++ steps [message #17118 is a reply to message #17114] Tue, 29 July 2008 17:23 Go to previous messageGo to next message
aldeacity is currently offline  aldeacity
Messages: 18
Registered: July 2008
Location: Spain
Promising Member
Hello!
Smile Well, I did'n write decimal code. In Firebird plugin I'm trying to write with Upp style but this is my first Upp adventure Wink I'll try to send code tonight. If not, tomorrow. But, I would like to know how must I lo link with Firebird library, so, what method do you think it's better.

Juan.
Re: First Firebird for U++ steps [message #17121 is a reply to message #17118] Tue, 29 July 2008 18:06 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

aldeacity wrote on Tue, 29 July 2008 11:23

Hello!
Smile Well, I did'n write decimal code. In Firebird plugin I'm trying to write with Upp style but this is my first Upp adventure Wink I'll try to send code tonight. If not, tomorrow. But, I would like to know how must I lo link with Firebird library, so, what method do you think it's better.

Juan.

could you tell what is the source of this decimal class? As for your question I don't fully understand but you should just link dynamicaly.
Re: First Firebird for U++ steps [message #17123 is a reply to message #17121] Tue, 29 July 2008 18:26 Go to previous messageGo to next message
aldeacity is currently offline  aldeacity
Messages: 18
Registered: July 2008
Location: Spain
Promising Member
Hello,

I'm writting Firebird plugin without decimal class. And about link, the question was about if I have to include conditions in package organizer.

Juan.
Re: First Firebird for U++ steps [message #17130 is a reply to message #17121] Wed, 30 July 2008 02:47 Go to previous messageGo to next message
aldeacity is currently offline  aldeacity
Messages: 18
Registered: July 2008
Location: Spain
Promising Member
Hello!

I've writing dli for Firebird plugin to manage fbclient.dll in Windows. My doubt is about if it is possible to use it in Linux system.

Thanks.
Juan.
Re: First Firebird for U++ steps [message #17160 is a reply to message #17083] Thu, 31 July 2008 23:48 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
unodgs wrote on Mon, 28 July 2008 06:35

luzr wrote on Mon, 28 July 2008 06:09

unodgs wrote on Mon, 28 July 2008 04:49

BTW: I think we could after a bit refactoring adopt you decimal class for upp. It's the only missing type of Value right now IMO.


I wonder whether this is implementation is a good tactics.

E.g. .NET seems to implement decimal as 128bit FP number with decimal exponent.

Mirek

Well we can start with anything. Implementation can be always changed. What I wanted only to say Decimal type would be very useful (+ plus EditDecimal, EditCurrency...)


I am not sure that it is that easy.... Chosen implementation will have a big impact later.

Mirek
Previous Topic: FireBird plugin and test program
Next Topic: SQLite: Date and Time
Goto Forum:
  


Current Time: Mon Apr 29 04:20:31 CEST 2024

Total time taken to generate the page: 2.90735 seconds