database

DB design/latency/concurrency, awful headache

I have a client-server application which gets all the data out of a couple of tables, recalculates something and stores it. Example: Each Item has a 'Bill of Materials' = the list and quantities of which other items it is made out of. Therefore the cost of an item is the sum of the cost of the items in its BOM * their quantities. Ultim...

Hibernate query by example (from Spring 3)

I've made my entity classes Adress, Road and County. A Road is in a County and an Adress in on a Road. I would like to list all the Adresses in a County. Therefore, in my AdressService I say: public List<Adress> AllAdresses(County county) { Adress adress = new Adress(); Road road = new Road(); road.setCounty(county); adress.setR...

Why are my accented characters breaking in SQL Server 2005?

When I update my database with this command: UPDATE myTable SET Name = 'Hermann Dönnhoff' WHERE ID = 123; SQL Server actually puts 'Hermann Do¨nnhoff' in the field instead. Instead of faithfully inserting the o-umlaut (char(246)), I'm getting two characters ( char(111) + char (168) ). This happens for all characters that have accent ma...

How to configure postgresql for the first time?

i have just installed postgresql and i specified password x during installation. when i try to do createdb and specify any password i get the message createdb: could not connect to database postgres: FATAL: password authentication failed for user same for createuser. how should i start? Can i add myself as a user to the database? ...

Should every field in an Oracle database have a check constraint if possible?

If I know the correct format of fields, should I create check constraints for all of those fields, or will this affect the performance of inserts/updates too much? Would it be a good idea to use regular expressions for complex rules, or should I only use simple constraints like case and length? The fields are already being validated at ...

backwardly compatible database changes

I had a discussion with our DBA about how to change a database schema. His opinion is that all changes must be reversible. For example: Obsolete tables/columns should not be dropped as soon as they become redundant. Instead, they should be kept for at least a few releases. Instead of renaming a table/column, create a new table/column a...

Date vs Milliseconds | for scalablility, saving, searching and obtaining time in Java + MySQL(or other Db's)

Which is the most beneficial in Java and a DB for DateTime? (Using JodaTime as Date) (DateTime object (Java) + TIMESTAMP (DB) ) VS (Milliseconds long (Java) + BIGINT(DB) for the use of DateTime information in Java Web application backed by an underlying Database Areas of interest manipulating, processing and memory usage in Java s...

Keeping distributed databases synchronized in a unstable network

I'm facing the following challenge: I have a bunch of databases in different geographical locations where the network may fail a lot (I'm using cellular network). I need to keep all the databases synchronized but there is no need to be in real time. I'm using Java but I have the freedom to choose any free database. Any suggestions on h...

open source data mining/text analysis tools in python

I have a database full of reviews of various products. My task is to perform various calculation and "create" another "database/xml-export" with aggregated data. I am thinking of writing command line programs in python to do that. But I know someone have done this before and I know that there is some open source python solution or simila...

Database relation many to many

This is basicly my database structure one product (let say soap) will have many retail selling size 1 liter 4 liters 20 liters In my "produit" database I will have the soap item (id #1) In the size database i will have many size availible : 1liter 4liter 20liter How not to duplicate the product 3 time with a different size....

Enums in the DB or NO Enums in the DB...

For me, the classic wisdom is to store enum values (OrderStatus, UserTypes, etc) as Lookup tables in your db. This lets me enforce data integrity in the database, preventing false or null values, etc. However more and more, this feels like unnecessary duplication to me. Not only do I have to create tables for these values (or have an un...

Business Logic in Database versus Code?

As a software engineer, I have a strong bias towards writing business logic in the application layer, while typically relying on the database for little more than CRUD (Create Retrieve Update and Delete) operations. On the other hand, I have run across applications (typically older ones) where a large amount of the business logic was wri...

what is qdb? database

At my work place they use qdb to store data. Can someone tell me in more detail "why qdb?" and can you refer me to some link so that I can read more about it? because everytime i search for qdb i find GDB pages ...

Increasing the performance for the sql in informix

Hi, Can any one help me in increasing the performance of below sql. Database using is informix SELECT informix.set_reason_codes.description as reason_code, count(*) as number_of_calls FROM informix.contact_history, informix.set_reason_codes, informix.customers WHERE (informix.contact_history.reason_code = informix.set_reason...

replace id with name in collection_select

In my application i have a collection_select on my members table, the members table only contains id's. It has an user_id, project_id, role_id, and so on. I want show the members name in the collection_select. But i only have the user_id in the members table, how can i show the names from the user table as options? <%= collection_selec...

(N)Hibernate find content from schema: Object <- AttributeValue -> Attribute

We have a common db schema of: Object <- AttributeValue -> Attribute lets say we talk about houses. The house can have lots and lots of attributes (door shape, roof color etc.). The number of attributes for concrete house is not known. Straight forward mapping to objects is used: House - contains collection of HouseAttributeValue ...

Unable to Recover Corrupt Oracle Datafile Block In SysAux

Hi, Oracle 10g on Suse 9.1 I'm looking after an Oracle DB. I have good SQL skills but I'm no DBA, (a diffence in job roles I have difficulty explaining to my non-IT savvy bosses!) I know enough to get Oracle up and running and put in place it's 'automatic' options for backup and optimisation then I leave it well alone. Everything else ...

Cronjobs in Django

I'm writing a database application where certain parts of the database might need updates based on time, not based upon user actions. For example, there may be certain values that are updated daily, and certain other values that must be updated say, four hours after the database entry is created. Thus I need some way to update values r...

Delphi ODBC Connection Dialog Component ?

Hi, I am thinking about adding ODBC database connectivity to an application. The user will at runtime configure and select their database odbc connection. Are there any components that will give me the required series of dialogs ? Allowing the user to select the data source type, select drivers, browse already defined ODBC connect...

Query tool for Oracle 9

I'm used to the comfort of working with MSSQL and the Enterprise Manager and Query Analyzer. Now working with Oracle 9.2 and having to suffer using SQL Plus for making queries, I'm looking for some better alternatives. Are there any free or low-cost tools for this purpose? ...