database

How to implement a 3 Many-to-Many relationship with Hibernate?

Hi, I'm not 100% sure this is only a Hibernate issue as this might be a more abstract decision but I'll give it a try. Since the problem description is a bit lengthy I'll first state that what I'd like to do is see if I can change the implementation to something which more resembles a Best practice implementation then this. I have 3 ent...

Generate Primary key without using Database

I came across a question recently that was for "Generating primary key in a clustered environment of 5 App-Servers - [OAS Version 10] without using database". Usually we generate PK by a DB sequence, or storing the values in a database table and then using a SP to generate the new PK value...However current requirement is to generate pr...

File based database in Java

Are there any libraries create programs in java that uses a file as a database and you don't have to install database services on the computer you are going to use it? ...

Are database deadlocks a fact of life?

We all know about techniques to prevent db deadlocks - acquire locks in the same order, etc. But at some point, systems under pressure may simply suffer from deadlocks here and there. Should we simply accept that and always be prepared to retry when a deadlock occurs or should deadlocks be considered absolutely verboten and should we do ...

Multi-language social website - Database driven?

To store multi language content, there is lots of content, should they be stored in the database or file? And what is the basic way to approach this, we have page content, reference tables, page title bars, metadata, etc. So will every table have additional columns for each language? So if there are 50 languages (number will keep growing...

Storing Connection String on Database

I couldn't find a question that would fit this purpose, so I'm asking it. We have deployed an ASP.NET website that has two Connection Strings, one of them can be configured by the user, in runtime. The problem is, since I'm using .NET Framework to do this, it creates a temporary file by the time the web.config is altered, which forces m...

Is there a good way to verify if a database schema is correct after an upgrade or migration?

We have customers who are upgrading from one database version to another (Oracle 9i to Oracle 10g or 11g to be specific). In one case, a customer exported the old database and imported it into the new one, but for some reason the indexes and constraints didn't get created. They may have done this on purpose to speed up the import process...

Can someone recommend a PHP/XHTML based solution for large and individual scale digital assets management?

i'm trying to set up a site where a substantial amount of PDFs will be sold both individually and a subscription will be sold to a library - so anyone from that library can visit the site without a paywall (so, based on IP). think JSTOR, for example, or a newspaper archive. I'm really comfortable with WordPress (can even dev plugins for...

Application Development: Should I check for a primary-key on a table or assume it should be there?

When building an application and you are using a table that has a primary key, should you check to see if the table has a primary key or does not have duplicate IDs? I ran into some code I'm maintaining that is checking to ensure no duplicate ids are in the result set. But the id that is being checked is a primary key. So to me this c...

Does this exists as a cloud service?

Database Redis Casandra MySQL (RDS, while nice, isn't quite agile enough) (other besides RDS) PostgreSQL Queueing RabbitMQ Beanstalkd Gearman Full text search Thinking Sphinx ...

How to have database name as variable in an SP?

We use stored procedures exclusively here, and that raises a little problem. We cross reference two different databases like dbdev..table1 in dev, dbqa..table1 in qa, and dbprod..table1 in production. So every time we deploy to a different environment, we have to search and replace from dbdev to dbqa or dbprod. Is there a way to use ...

Getting data from multiple tables when using the Zend framework?

Is there a best practice in getting data from multiple database tables using Zend? I would like to know rather than end up wanting to refactor the code I write in the near future. I was reading the Zend documentation and it said that: "You can not specify columns from a JOINed tabled to be returned in a row/rowset. Doing so will...

getting data from 3 tables via a recurring id

I have a database with 3 tables in this structure, CREATE TABLE `mailers` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mailer_title` varchar(150) NOT NULL, `mailer_header` varchar(60) NOT NULL, `mailer_type` enum('single','multi') NOT NULL, `introduction` varchar(80) NOT NULL, `status` enum('live','dead','draft') NOT NULL, ...

How can I create a odbc layer on top of existing business data?

I want to expose our internal bussiness data through odbc driver. One of the propitary product that i found is DataDirect OpenAccess. I want to use SQL to query live data from our data source. Writing my own SQLEngine will take ages but i need something like following diagram. We intend to use it on live data so exporting it to database ...

Purpose of MySQL data type

Often when creating a new web app and configuring MySQL, certain fields will need to change in format as the app develops. For instance, I may change the format of a date field or a field which once was just int now needs a letter or what not. So usually I just make every field Varchar 255 until Im finished at which time Ill change dat...

How to set up DBAppender with log4j in JBoss5?

I would like to be able to set up my clustered JBoss5 instances to write log4j messages to a database. I am trying to use a DBAppender (rather than a JDBCAppender, for the reasons given in this question). Has anyone done this? As of now, I've added an <appender> tag to jboss-log4j.xml and put the logback-classic-0.9.17.jar file in every...

How do I query a SQL database to return the first "page" containing the specified data?

------------------------ | | A | | ------------------------ | | B | | ------------------------ | | C | | ------------------------ -----Page 1 | | D | | ------------------------ | | E | | ------------------------ | | F | | ------------------------ --...

Fastest way to populate a Db

I have an excel spreadsheet with products and categories with a many to many relationship and i need to populate the db with it. I am searching for a quick way to enter this data in and have the join table have all the correct info. I have phpmyadmin but it seems to be a bit slow unless there is a shortcut. Another approach i was thinkin...

How to return "row number" of first occurrence, SQL?

(row number not stored in db) ------------------------ | | A | | (1) ------------------------ | | B | | (2) ------------------------ | | C | | (3) ------------------------ -----Page 1 | | D | | (4) ------------------------ | | E | | (5) ------------------------ |...

send radiobutton's value to different fields at DB

i have a submit form that consist of 1 group radio button. <div id="defectclass"> <input id="def1" type="radio" class="defect" name="defect" value="1"/>S <input id="def2" type="radio" class="defect" name="defect" value="1" />A <input id="def3" type="radio" class="defect" name="defect" value="1" />B <input...