database

How can I have DBIC persistent database connection in mod_perl?

I am using mod_perl for my web application. Currently, I plan to use a mysql database across the network. In every CGI request to display_customer_transaction.cgi, my script will Open up database connection across network Perform query on the database using SQL statement Analysis the data retrieved from database Print out the data in H...

database use with ExtendScript (for Adobe Illustrator)

I want to refactor a VB program into ExtendScript to automate some drawing in Adobe Illustrator CS4, but have a requirement to read from a database. Is it possible to read from a database using ExtendScript? How? ...

Another Many-Many Scenario

My database model has 2 particular tables in it that require a many-to-many relationship. The tables are Systems and Users. One user can be a member of more than one system and one system has more than one user in it. system_id is the PK in the system table and user_id is the PK in the user table. I have them linked with system_id as a...

SQL Server COMPILE locks?

SQL Server 2000 here. I'm trying to be an interim DBA, but don't know much about the mechanics of a database server, so I'm getting a little stuck. There's a client process that hits three views simultaneously. These three views query a remote server to pull back data. What it looks like is that one of these queries will work, but the...

How to access phpMyAdmin on remote server

For my websites I use Dreamhost. Dreamhost requires you to create a hostname (ex: mysql.mclindigital.com) that the database will reside on. For me it's simple, if I want to access phpMyAdmin, I simply navigate to mysql.mclindigital.com, and it enters into phpMyAdmin automatically. Apparently Dreamhost is in the minority using this met...

Best way to query calendar events?

Hi, I'm creating a calendar that displays a timetable of events for a month. Each day has several parameters that determine if more events can be scheduled for this day (how many staff are available, how many times are available etc). My database is set up using three tables: Regular Schedule - this is used to create an array for eac...

What is a good balance in an MVC model to have efficient data access?

I am working on a few PHP projects that use MVC frameworks, and while they all have different ways of retrieving objects from the database, it always seems that nothing beats writing your SQL queries by hand as far as speed and cutting down on the number of queries. For example, one of my web projects (written by a junior developer) exe...

Unit testing against large databases

I would like to ask about your suggestions concerning unit testing against large databases. I want to write unit tests for an application which is mostly implemented in T-SQL so mocking the database is not an option. The database is quite large (approx. 10GB) so restoring the database after a test run is also practically impossible. T...

Database deadlocks

One of the classical reason we have a database deadlock is when two transactions are inserting \updating tables in a different order. e.g. Transaction A inserts in Table A then Table B and Transaction B inserts in Table B followed by A Such a scenario is always at risk of a database deadlock (assuming you are not using serializable is...

Index on images to access data in a database

Hi We have the Trie structure to efficiently access data when the key to that data set is a string. What would be the best possible index if key to a data set is an image? By key, I mean some thing which uniquely distinguishes data. Is this a less frequently used scenario i.e. accessing data by an image? I do feel there are application...

Differentiate empty from NULL query results

I've got a table with measurement data in SQL Server 2005, one value per person and year, if available. My TSQL code fetches these values in a loop and processes them: ... SET @val = (SELECT measurement FROM tbl_data WHERE persid = @curpersid AND yr = @curyear) ... Now, for a certain person and year, the table can contain (i) a valid ...

Order By query ignores punctuation marks

This is with Postgresql. A column in a table contains string values with punctuations. The values are "aac", ".aaa", "aa_b", etc. When this column is specified in order by clause, the order of results is almost random. The strings starting with a period should appear at the top, which doesn't happen. They appear somewhere in the middl...

How to update a database schema without losing your data with Hibernate?

Hi everybody! Imagine you are developing a Java EE app using Hibernate and JBoss. You have a running server that has some important data on it. You release the next version of the app once in a while (1-2 weeks) and they have a bunch of changes in the persistence layer: New entities Removed entities Attribute type changes Attribute na...

Comma separated values in a database field

I have a products table. Each row in that table corresponds to a single product and it's identified by a unique Id. Now each product can have multiple "codes" associated with that product. For example: Id | Code ---------------------- 0001 | IN,ON,ME,OH 0002 | ON,VI,AC,ZO 0003 | QA,PS,OO,ME What I'm trying to do ...

Recommended Globalization References

I'm working on a web application that is globalized. The development process is agile style, with several sprints already completed. Our globalization framework is good and localization efforts have been successful so far. However, we continue to run into questions during requirements development, particularly in data storage and vali...

Best practice for keeping named constants in code and database reference tables in sync?

It's generally best practice to use named constants in place of magic numbers, but it sure is tedious and error prone keeping a database reference table and a file of named constants in sync. Is there some easy way to keep these two sources for this info in sync, or am I overlooking an obvious design enhancement? In case my question isn...

Core Data syncing

Hi, is there a way to automatically sync my Core Data Model with a server (preferably REST)? Thanks ...

"ImportError: No module named dummy" on fresh Django project

I've got the following installed through MacPorts on MacOS X 10.5.6: py25-sqlite3 @2.5.4_0 (active) python25 @2.5.4_1+darwin_9+macosx (active) sqlite3 @3.6.12_0 (active) python25 is correctly set as my system's default Python. I downloaded a fresh copy of Django 1.1 beta (I have the same problem with 1.0 and trunk, though) and instal...

Data Viewer for AppEngine (Java) development server

The Google AppEngine development server simulates Google's backend database with an embedded database. It creates a file on you local disk that you can delete to clear the DB. Is there a tool that allows to browse and edit this data, similar to the Data Viewer that you get for deployed applications? Clarification: I am asking about the ...

Databases from scratch

How do I create a database management system from scratch? Are there any books, sites and tutorials with great quality? With great quality I mean that it should be simple to use and straight forward in explaining the concepts. Here are examples of caliber quality resources that I'm looking for: If I were to create an operating syste...