MySQL: Building User Interfaces
What's in the book? The first chapter guides the reader through the basics of MySQL and how it compares to Access 2000 and SQL Server 97. Next, a code listing demonstrates the basics of connecting to MySQL via C using the MySQL C API. the book gives an all-too-brief whirlwind tour to the basics of MySQL. The next four chapters are a tutorial on how to use GTK+ and GLADE, focusing on how these toolkits are similar and different from their Visual Basic counterparts. GTK+ was chosen in this book because of its cross-platform compatibility with both Windows and Linux / UNIX operating environments. The second part of the book takes what was learned about MySQL and GTK+ with GLADE and uses it to create a stand-alone application (a real-world order-entry application). What's Good? Throughout MySQL: Building User Interfaces, Stuckey describes exactly what he is doing and why he is doing it that way. The introduction to GTK+ in the first part of the book describes just about every GTK+ widget available (menus, buttons, sliders, status bars, etc.), and creates a monster busy-box application (not to be confused with the busy-box application by Bruce Perens) demonstrating those widgets by themselves. Later in the book Stuckey uses Glade to put applications together, but not using Glade early on gives the reader a chance to see what is happening under Glade's abstraction. During the building of the order-entry application, Stuckey explains the design decisions behind the widgets. Each window of the application is introduced first with a diagram describing where the widgets will be followed by the code for each widget. The design looks like a Visual Basic application designed by a a programmer, with an eye toward the functional rather than the aesthetics of user interface design, but as an introduction to GTK+ programming it works well. What's Bad? If there was ever a book that required a CD-ROM to accompany it, this book gets my nomination. Authors have to walk a fine line between presenting code snippets that don't make sense by themselves, or risk boring readers with page after page of code that might confuse readers who aren't yet ready to view full code listings. MySQL: Building User Interfaces chose to include the full code listing for everything. This is both a blessing and a curse: readers have the code right in front of them and don't have to worry about being in front of a computer while reading the book, but the flow of the book is interrupted every time something is introduced.
The descriptions also suffer, because those code listings are expected to explain in more detail what is going on. In the GTK+ introduction, widgets are introduced with short paragraph introductions. The real-world application, which should be the focus of the book, reads like an assembly line: A screen is introduced, the widgets are placed, and the code is listed. Worse, files which make little sense without a computer (such as files generated by glade) are presented along with the code listings. This makes reading this book a chore. Thankfully, there is an FTP site with the code ready to use, but future versions of this book would be best served to include it on disc.
Perhaps a balance can be struck in a future edition where important code concepts are highlighted without sacrificing seeing the code in a meaningful context.
So, what's in it for me? Windows programmers who need a hand in getting their applications to Linux or UNIX may find this book helpful (but overwhelming) as they learn. This book stands out as a bridge for Windows programmers to make their transition to Linux and UNIX smoother, but the emphasis and amount of code listings in this book may make Windows programmers choose a different route.You can purchase MySQL: Building User Interfaces from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
MS Access has the advantage (on Windows machines anyway) of being a stand-alone database without needing a service to be installed. For a app where you don't want to have to install MySQL server and have it waste resources, you might consider SQLite. Unlike MySQL embedded, it's release under the public domain. MySQL Embedded is licensed under the GPL and has the following requirement:
Although, depending on what you want to do with the software, this may not be a problem. I'm all for free and open source software, but a brother's gotta eat too.
amazon link
isbn.nu link
half.com link
No affiliate tags are used above. But here's the amazon link with my tag, if you feel generous.
I have read this book, and used it to my advantage. However, they don't properly explain some parts about what you're doing, and why you're building the interface. I was hard pressed to find the exact reasoning they used for some of the things they did, but other than that, it's a great resource for mysql developers such as myself.
Before all the naysayers start in on what a flaky database MySQL is, how it doesn't do this or that, that it just a toy, please visit their web site and see what its current feature set is.
"Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
Before that, the dang thing doesn't support nested subqueries, or any kind of subqueries on inserts and deletes. Found that out the hard way recently (the docs don't make it very clear) and had to rewrite a bunch of elegant SQL as less elegant Perl loops and wacky joins.
Still, I love MySQL. Postgres is more full featured, but for the smallish web-based applications I write, it's overkill.
- None can love freedom heartily, but good men; the rest love not freedom, but license. -- John Milton
I've been working through this book for quite some time, and now that I've extracted all i can I have to declare myself delighted with it. The examples are good, deep enough to convey the lessons but shallow enough that not too much is irrelevant. I now have, as the author promised, several applications that will compile easily under both linux and win32. If i can fault the book at all , my only reservation is that is would have been nice to see all the necessary software included on the cd. Downloading all of the required applications and libraries (particularly for windows) led to a treasure hunt accross the web. That aside I would recommend this book to anyone who is not new to programming and databases, a little prior knowledge will be required as this is definately not a complete beginners book.
I read most of this book (maybe an older version?) last year. I found it very interesting because it basically gave me the idea to let the staff members of my web site update the site through a windowed interface as opposed to a web interface. MySQL doesn't have to be running on the same computer as the program is running on, so this would be simple. That way you could provide a rich client (for staff members, not end-users) to update a web site based on MySQL.
I know, it's not an original idea, but it's interesting because the book was a nice, step by step guide to doing just this. For what it's worth, I enjoyed it.
On the other hand, I ended up spending time with XUL instead.
It is an open source program similar to Microsoft Access. It works with MySQL too. It even runs on Windows.
Nero-burning ROM for Linux!
MySQL: Building User Interfaces chose to include the full code listing for everything. This is both a blessing and a curse: readers have the code right in front of them and don't have to worry about being in front of a computer while reading the book
Since when do people read computer books on the throne? I would think anybody who's interested in this book (yes, you two hiding at the back!) would be reading it in front of a computer, trying out the sample code to learn what's going on.
"A door is what a dog is perpetually on the wrong side of" - Ogden Nash
Recently I had to write a mysql demo for a tradshow. I had
never worked with mySQL before. I got this book and was
able to complete a full fledged demo in a matter of three
days, working part time. The book is very well organized,
easy to read and understand and best of all the examples
work without modifications. I highly recommend this book
for beginners. I would have done so for all levels but
I'm not an advanced user of mySQL.
If you're thinking of getting started on mySQL this is the
book.
I have this book on my desk currently, its definitely a good resource on using MySQL for programs. The only gripe I had with it was that it didn't come with the source code, like was said in the review. I like how it focuses on converting the VB programmer over to GTK conventions.
Maybe someone should send Mike Rowe a copy after he gets out of Redmond-Training.
Slashdot sucks
Would you *reallY* like users installing MySql on their machines with the easiest to use options (read:insecure options) by default? GUIs are much worse. Best to stick with raw SQL and text files, that way you *have* to learn to secure the system.
Nero-burning ROM for Linux!
from the sql lite page it looks like multiple users can select silmultaneously but only write to the database one at a time. Locking for writes is not record level, page level or even table level - it is the whole database.
Too bad- because MySQL really does not replace Access but neither does this- unless it will only run internally to one user.
It's hard to believe that's how Micronians are made. Why don't we see it right now by having you both kiss one another?
But do we really want the book to only scratch the surface in many languages rather than give it thoroughly indepth with a single language? I often find it frustrating when chapter upon chapter is dedicated to a language I'll never use. If however you want lots of other languages covered, the MySQL Cookbook by O'Reilly has good scenario based discussions of using MySQL with PHP, JSP (as you wanted) as well as Python and Perl.
if you are a windows programmer then you must be retarded
I know many retarded people that would be offended by that statement.
Seriously though, making sweeping statements like that just makes it obvious that you were never good enough for the high school debating team...
...might be to use a higher level language wrapper like Ruby/GTK.
Prototyping an app will probably take less time if you don't have the compile/link cycle... worth a try, anyhow.
The Army reading list
Couldn't the author have made a little more recent comparison to database technologies? AFAIK, SQL server is at version 2k, and Access at version 2k3.
Computers are useless. They can only give you answers.
-- Pablo Picasso
Don't confuse stupidity with lack of political engagement / ethics / knowledge / possibilities. I know quite a few people who are more or less stuck with Windows for various reasons (the main one being their employers' decision to - willingly or not - support Microsoft), but who would like to learn more and be able to break free. If a book like this can help even a few people gain some of the skills they need to migrate, it's a good thing.
This signature is not in the public domain.
I don't get why so many people are stuck on MySQL. It's lacks some very, very basic features: Views, Triggers, Stored procedures, nested selects. Sure, they promise support for all this in future version, but PostgreSQL supports it NOW. If you want a full-featured open source database, don't use MySQL, use Postgres.
Not that I'd be interested in a comparison between MySQL and SQL Server (midrange C/S replacement for Access/FoxPro - OK. Enterprise RDBMS? No)... but still.
MySQL is listed with OVER 20.
It's not about being a postgres fanboy/troll.. reality is that MySQL DOES NOT have features comparable to Oracle/PostgreSQL/SQL Server. When are you going to understand this??
As a DBD (db developer) I CAN'T use MySQL - it's feature set is too WEAK. MySQL is starting to get some of these features now and good for them but the argument was always about the feature set.. fuck some of you are dimwits...
And yes I've just fed a troll but fuck it, now im all pissed off and want another coffee..
"If you are a Windows programmer looking to create or move your stand-alone database applications away from Microsoft-specific tools such as Visual Basic, Visual C++, Access or SQL Server, MySQL: Building User Interfaces is written just for you."
Very few Windows applications are written in 'C' these days so converting an existing application to use MySQL would be pretty painful. You should have a better reason to port your code then simply avoiding MS tools.
Perhaps the book is better suited for developers who wish to switch to Linux for future development.
...if you don't use transactions, stored procedures, triggers, views, sequences (read: real ones), or if you actually want your database to be typesafe and have your insert/update to throw an error (or at least a warning!) on invalid data. Otherwise MySQL is most certainly not a viable replacement, although the codebase which used to be called SAPDB is. Firebird also qualifies for a replacement.
Also, if you need advanced XML querying tools for your database, none of the open source RDBMSs can currently act as a reasonable drop-in replacement for MS SQL Server.
If you don't need any of those features (and especially haven't actually used any of them in existing code), then MySQL could be added to the list of open source RDBMSs that fit the requirements for your project.
- I don't need to go outside, my CRT tan'll do me just fine.
They got shafted by TheKompany and need some help so download it a send a few bucks their way if you like it. Runs on Linux and Windows.
Help fight continental drift.
...wouldn't the effort be better spent in actually bringing mySQL up to the point where it *can* replace SQL Server?
MySQL seems to occupy a rather subtle and narrow niche, perhaps the 'single smallish website' niche. I can't really imagine wanting to use it when most applications are liable to grow beyond that niche.
PostgresSQL looks a lot more encouraging, feature-wise, although it doesn't seem to offer many concrete benefits over SQL Server. Still, to me, a book on migrating to PostgresSQL or another full-featured RDB would be more useful.
Whence? Hence. Whither? Thither.
- Obviously not everyone has Access. Many do, or have access to it via work or school (access to Access?!?)
- There were certain things that were easier to implement in an HTML-based setting (conversely, there's things I still can't equal that were accomplished easily using VB & Active-X. Things such as a customized file browser with a built in image viewer)
-
While some of my VB code and Active-X'ing would have been transferable to the web, it would have required requiring that the user of my system use IE to administer it. Not gonna happen!
-
I just don't like Microsoft enough to make my product only available to users of their software. The above IE example would have required my admins to IE; Access would require users to have Access; Having Access implies that the user must also run Windows (Wine just isn't there for Access usage I'm afraid. At least not for very advanced usage)
But for other projects I have, who's target audience is Windows users, Access is a great way to quickly build some impressive mySQL-based applications. IMHO, of course. 8)=ok, so postgresql has two issues with syntax, and mysql has dozens of situations in which it will silently fail.
r /manual_Introduction.html#Bugs
And that's comparable?
If you want to read something amazing, go ahead and read the MySQL manuals, look for design deficiencies: http://www.mysql.com/documentation/mysql/bychapte
You'll see more than just minor syntax issues - you'll see that mysql spends most of its time in silent error mode.
INSERT INTO test
(id, num1, num2, num3, price, code)
VALUES (
0,
99999999999999,
NULL,
'A quick brown dolphin...',
21474.83,
'ABCDEFGHIJK'
);
Now the syntax should be kosher.
And I applaud you for that. It's good to know that you never make mistakes, are always fully rested, are never up against a hard deadline, etc. I'm not questioning your coding skills or your intelligence. On the contrary, I think that extra checks are always worth it. What I am saying is that the database, the final repository for your data, should be making at least the same amount of effort.
When the string 'A quick brown dolphin...' is passed to an integer field because I'm overly tired, a collegue hasn't been as rigorous as I usually am, some crack-smoking intern had a brain fart, or whatever, the fact remains that MySQL detected that it wasn't an integer. It didn't try to throw it in as the first 32-bits of the binary string. The table needed a number, MySQL had no idea what number you meant, and it decided to put in the default value for the column according to its datatype. In other words, it placed a value that I didn't explicitly specify through the client or schema and did not warn the client that it had done so.
Imagine if all of those POSIX networking functions didn't return an error code. Why not? I'm sure there are folks out there who will say, "But my network is always up, the cables are of highest quality, and in all the time I've worked there, I have never had a socket connection fail; so why do I need the error code back?" No matter the preparation, no matter the training, no matter how good the conditions are, when the rubber hits the road, I would like to be able to see out of the windshield to see if I've spun out.
This is the salient point that people (including the pager-adorned gentleman in the parent post) appear to blithely ignore. It's the giant pink elephant in the corner that everyone notices but no one wants to talk about.
By all means, perform the extra checks. Perform a check at compile time, at deploy time, and at runtime. Why are MySQL folks so averse to having a check at insert/update time as well? Why is it such an affront to want your database to do its own data integrity checks? Why is it so horrible to expect a relational database to do its job!? I honestly want to know. I would very much like some insight into this rather than picking on my choice of salad fork.
- I don't need to go outside, my CRT tan'll do me just fine.