database

What exactly is a foreign key?

Ok. So I know what a primary key in DB is. If you have a table in a database, a primary key is a single value that is unique to each row in your table. For example: id | name | whatever ------------------------- 1 Alice .... 2 Bob .... 45 Eve .... 988 .... .... So I need a good, simple examp...

Hibernate <generator class="" > When is it best to use what?

I am relatively new with Hibernate. I used Persistence and Toplink prior to this but didn't help too much when learning Hib. When I define my entity classes, specifically the id attributes,I find myself not knowing which values to use. Obviously theres different situations that call for different values. What do some of these values mean...

Virtual directories as DB queries

I have a site, e.g. site.com I would like users to be able to access it in their locale at site.com/somecity This is similar to craigslist, but they do it with subdomains e.g. sfbay.craigslist.org Using Apache HTTP server. MySql for DB. If you can provide a brief explanation and perhaps links to more thorough discussions, I would be qui...

How to determine the "number of pages" most effectively?

Hi! I hope I'm not writing a duplicate, but I haven't found anything that answers my question. (Although it seems to me to be quite common problem.) The problem occurs in nearly every web project: You have a table with many many entries and want them to be displayed on single pages. Now I wonder what's the best way to compute the num...

What is the best CASE tool for database development and why?

I know there are a large number of CASE tools out there, some better than others, but what are the ones used by those in the field, and why do you use those specific tools? In this case, I am just interested in CASE tools for database design, and more specifically, ones that will let me "draw" the schema diagram, and then will create th...

How to setup MySQL Database Relationship

I have a database that has two tables "locations" and "classes". I am familiar setting up some sort of parent/child situation with my database tables, but this one has thrown me for a loop. This relationship works exactly like you'd expect. The "locations" have multiple "classes". But some of the "classes" are at multiple "locations"...

Good reasons to put an index on a rarely queried heap

I have several tables with more than 1000 pages and fragmentation above 30% and commonly around 90%. ---- Edit: Thanks for the comments. It boils down to this - if a table is not being used in a relational context, what are the benefits of putting a clustered index on the table? I know it can save space, since it can now be defrag...

Database for Open Source Project

Which database would you use for an Open Source Project? I am looking for something that has little or no setup required by the end-user. Update: Database size will be relatively small (less than 100,000 records). Application will be written in C#. ...

Secure JDBC connection

I have a plain Java application which is supposed to connect to the database. I don't want to store database connection url and username/password in a properties file or hardcode it in application. What is a common way to solve this problem? How a Java application can connect to database without revealing username/password? ...

uploading a realtime database into the web

Hi everyone I hav a small problem in uploading my database. I have created a localhost website on my pc for a vehicle tracking system and now i have no clue in uploading it. Its got two microsost access databases in my pc which is used in the website and they get updated at very regular intervals(almost every second) it has to be uploade...

DBArtisan performance tweaks

DBArtisan 8.0.0 is egregiously slow on my machine (win XP 2 GB RAM). There is no logging or tracing enabled. Yet, every time I try to type a query or switch between tabs, the tool hangs for several minutes. Are there any tweaks I can use to improve performance of DBArtisan ? ...

Is it faster to search for a large string in a DB by its hashcode?

If I need to retrieve a large string from a DB, Is it faster to search for it using the string itself or would I gain by hashing the string and storing the hash in the DB as well and then search based on that? If yes what hash algorithm should I use (security is not an issue, I am looking for performance) If it matters: I am using C# a...

How are Database Programmers Different?

How are database programmers different from other programmers? How is their skill set different? What are their strengths and weaknesses? How do their personalities compare? Can these generalizations even be made? ...

Can you export packaging information (ERD or other data model) from Cognos 8.3?

Hey, I was wondering if there's a way to export package information from Cognos 8 from a regular user level or from the framework level. For instance, I want the field names that cognos is pointing to on the database, i want the datatype, the description cognos uses when you right click a data element, etc.. Any suggestions? ...

Linq To Sql - ChangeConflictException not being thrown. Why?

I am trying to force a ChangeConflictException by altering records in two different browsers. This has worked for me in the past. But now it just wont throw the exception. Last one in is winning. I have checked the column properties of the entity I am updating and each column is set to always check. Is there anything I can look for? ...

Column Stores: Comparing Column Based Databases

I've really been struggling to make SQL Server into something that, quite frankly, it will never be. I need a database engine for my analytical work. The DB needs to be fast and does NOT need all the logging and other overhead found in typical databases (SQL Server, Oracle, DB2, etc.) Yesterday I listened to Michael Stonebraker speak a...

What is a good reverse db engineer tool for NHibernate?

Does anyone know of a good tool to reverse engineer mappings and business classes for NHibernate? NHibernate is best for greenfield development, but we also need to work with large legacy databases. I've tried NGen, which does ok, but it does the entire DB and you cannot select individual tables or map to sprocs and it maps a UNIQUEIDENT...

What is the best data structure to use for an offspring relationship?

There must be a standard data structure to hold, for instance, dog breeding information, plant genetic crossbreeding, and complex human relationships. One might think it would be an easy tree structure, but the combination of two (or more, for genetic engineering) parents per offspring, multiple different offspring per parent set, multi...

Why is it not advisable to have the database and web server on the same machine?

Listening to Scott Hanselman's interview with the Stack Overflow team (part 1 and 2), he was adamant that the SQL server and application server should be on separate machines. Is this just to make sure that if one server is compromised, both systems aren't accessible? Do the security concerns outweigh the complexity of two servers (ext...

Should a PHP application perform error handling on incorrect database values?

Imagine this... I have a field in the database titled 'current_round'. This may only be in the range of 0,1,2,3. Through the application logic, it is impossible to get a number above 3 or less than 0 into the database. Should there be error checking in place to see if the value is malformed (i.e. not in the range 0-3)? Or is this just ...