Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 10th, 2002, 08:49 AM
Nuga Nuga is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Newfoundland, Canada
Posts: 138 Nuga User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Database abstraction later - any hep?

Hello - I need to use MS SQL 2000 on an IIS machine with PHP, we are used to developping on a Unix platform and want to be able to write SQL for MySQL and have it work on the MS SQL databse, i.e. we want to use a database abstraction to be able to transfer our code between the two platform.


Basically, what I want to know is will anyone recommend for or against AdoDB and ODBC as a database abstraction layer IIS / are there any benchmarks for MS SQL performance with these factors?

BTW - I can NOT use the php native database connection classes - sql code will be different between MySQL and MSSQL.
Thanks.

Steve

Reply With Quote
  #2  
Old June 11th, 2002, 10:58 PM
dcaillouet's Avatar
dcaillouet dcaillouet is offline
Big Endian
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2001
Location: Fly-over country
Posts: 1,172 dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 16 h 29 m 5 sec
Reputation Power: 29
I do not have a good answer for your question but I thought I would throw out a couple of suggestions that might help you with your problem. If I wanted to develop MS SQL code on a Unix box and port it over IIS with the minimum amount of changes I might try:

1. Download the free version of Sybase for Linux. Sybase syntax and SQL Server syntax are very close to one another since they used to be the same product back at version 4.x. I have developed code on a laptop using the Microsoft MSDE and ported the other way (to a Sybase database) and it worked well.

2. Abstract your database by using stored procedures instead of straight SQL statements. If you had Sybase, Oracle or any other database that supported stored procedures running on a Unix box, as long as your stored procedures in SQL Server were named the same, accepted the same parameters and performed the same task, the code should be portable.

3. Have an IF-THEN-ELSE statement based on a global variable to pick the correct SQL statement. You would just toggle the variable depending on which machine you were running on:

if MySQL
sql = "SELECT CONCAT(FirstName, ' ', LastName) AS FullName FROM tablename"
else
sql = "SELECT FirstName + ' ' + LastName AS FullName FROM tablename"

4. Have all of your database specific SQL statements and connection routines defined in a seperate file. Include that file in your web pages. The file would be named the same on both the IIS and the Unix machine, but each one would have different content.

Reply With Quote
  #3  
Old June 12th, 2002, 03:26 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 8,527 pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 1 Day 3 h 19 m 49 sec
Reputation Power: 537
Try ADODB http://php.weblogs.com/ADODB hope this helps. And please report on your experience!

Reply With Quote
  #4  
Old June 12th, 2002, 08:19 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,163 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 6 Days 1 h 34 m 20 sec
Reputation Power: 791
Just as a note, when comparing ODBC to the native database functions in php, ODBC is slow.

Reply With Quote
  #5  
Old June 12th, 2002, 08:34 AM
Hero Zzyzzx's Avatar
Hero Zzyzzx Hero Zzyzzx is offline
11
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2001
Location: Lynn, MA
Posts: 4,635 Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 44 m 19 sec
Reputation Power: 81
Send a message via AIM to Hero Zzyzzx
If you're not bound to PHP, then I suggest checking out perl and DBI, which is a true database abstraction layer.

It's very, very mature and allows you to use databases with the exact same interface- if you don't use database specific functions, you can actually switch seamlessly between different RDBMS's.

And Perl, run under mod_perl, is just as fast as PHP. (there is also mod_perl similar modules for IIS, I believe activestate has them.)

Reply With Quote
  #6  
Old June 12th, 2002, 08:56 AM
Nuga Nuga is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Newfoundland, Canada
Posts: 138 Nuga User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
I am tied to php for now, and also to microsoft sql server 2000. AdoDB seems like a possibility for now. Anyone have a reason why not or any REAL benchmarks (the ones on their site suck).
Thanks again

Reply With Quote
  #7  
Old July 8th, 2002, 02:26 PM
beetrader beetrader is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: London/Stockholm
Posts: 4 beetrader User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Excuse a newbie for interrupting a discussion above my head, but I am very curious to know if there is any special reason PEAR is not mentioned here? (URL)

It's the only database-abstraction-something that I knew before I read this thread, and since I'm working on an application that must connect to all kinds of places I use it. And it's free - are they all? I only tried it with MySQL so far, though.

Kindly, Beetrader

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Database abstraction later - any hep?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap