database

Database design: How should I add an information which can apply to several tables

I am constructing a database System using Mysql, this will be an application of about 20 tables. The system contains information on farmers, we work with organic certification and need to record a lot of info for that. In my system, there are related parent-child tables for farmers, producing years and fields/areas - it's a simple repr...

Check value at insert

Hello, i have this three tables. Table: Item Columns: ItemID, Title, Content, NoChange (Date) Table: Tag Columns: TagID, Title Table: ItemTag Columns: ItemID, TagID In the Item Table is a Field with NoChange, if this field = true no Tag is allowed to insert a ItemTag value with this ItemID. How can i check this in the insert? For U...

jQuery Fade Out an <ul> and Fade In Info From DB

On my portfolio page I have this setup: <div id="portfolio"> <ul id="sites"> <li> <h3><a href="#">MotorSomethin</a></h3> <img src="http://dummyimage.com/265x100/000/fff" /> <p> We tried going for a very dark but flashy look for this website. Hence the reason we used fla...

Are there any e-commerce websites that use NoSQL databases

I have read a lot lately about 'NoSQL' databases such as CouchDB, MongoDB etc. Most of the websites I have seen using this are mainly text based websites such as The New York Times and Source forge. I was wondering if you could apply this to websites where payment is a huge issue. I am thinking of the following issues: How well can yo...

java database backup and restore

How do I backup / restore any kind of databases inside my java application to flate files.Are there any tools framework available to backup database to flat file like CSV, XML, or secure encrypted file, or restore from csv or xml files to databases, it should be also capable of dumping table vise restore and backup also. ...

Simple question on database query.

I have been asked in an interview to write a SQL query which fetches the first three records with highest value on some column from a table. I had written a query which fetched all the records with highest value, but didn't get how exactly i can get only first three records of those. Could you help me in this. Thanks. ...

archiving strategies and limitations of data in a table

Environment: Jboss, Mysql, JPA, Hibernate Our web application will be catering to a large amount of users (~ 1,000,000) and there are a lots of child table where user specific data are stored (e.g. personal, health, forum contributions ...). What would be the best practice to archive user & user specific information. [a] Would it be...

what is a commit log?

in google's bigtable context, what does a commit log mean? and what is the use of a commit log? ...

I need a mechanism for locating SQL server instances

Hi I have an idea and I want to apply it to my Application (C# .NET). When we connect to a DB (MS SQL Server 2008) in VS 2008, the ConnectionString saved in the Application Setting and it's a static varriable (no one can edit it unless you edit it inside VS 2008). I want a way to let my Application search for MS SQL Server and save it...

How to retrive user input data entered tab bar View Controller when application start in iphone app

Hello, I have created window based application. Tab bar controller as root controller and it has three tabs. One Tab has Labels and TextFiled inputs like Name, Username and Password. I am looking to store this text filed inputs when user enters and able retrieve in other tabs. Previously I have set key for different text fields and se...

What’s the strategy to recover data during DAO unit test?

When I test DAO module in JUnit, an obvious problem is: how to recover testing data in database? For instance, a record should be deleted in both test methods testA() and testB(), that means precondition of both test methods need an existing record to be deleted. Then my strategy is inserting the record in setUp() method to recover data....

Best way to update record X when Y is inserted

I have a huge table that is mainly used for backup and administrative purposes. The only records that matters is the last inserted record. On every hit to order by time inserted is just too slow. I want keep a separate table with the last inserted id. In PHP I now insert, get last inserted id, and update the other table. Is there a m...

PHP - How to insert special characters into a database?

Hello. Can anyone tell me how to insert special characters into a MySQL database? I've made a PHP script which is meant to insert some words into a database, although if the word contains a ' then it wont be inserted. I can insert the special characters fine when using PHPmyAdmin, but it just doesn't work when inserting them via PHP. Cou...

How do I display each view once as they are loaded, in Android?

I have an Android application that works off of a smaller database, around 300 entries. To view the database, I have created a custom view that contains individual rows of data. Then I query the database, and add each line to a newly created custom view. The problem is that it takes a little white for all of this to be created/loaded, s...

Should we drop stored procedures and run database calls from java programs.

I am fighting to keep the use of stored procedures in our company. There are a few people who say they are bad and we should not use them. We are using DB2 on the i-series. Please help in my argument to keep stored procedures alive in my company. ...

Migrating a Large amount of data from old publishing site to new site

Hi, I am currently in the process of creating a new news/publishing site on the Movable Type platform. There are around 20 or so sites with 20,000+ rows of data to be moved/aggregated to ~8 sites (we have a number of location specific sites and are going to aggregate the content from these into 1 single site for each niche). We have di...

php form-input validation

i have a html page in which i enter data which then submits and inserts in a database on a php page. how would i validate in php that the data received is not a duplicate of the data in the database? any help appreciated. ...

Help with ListView Databse

I am having issues @ run with this code: App Force Closing.. Sprinter.Java import android.app.ListActivity; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.widget.ListAdapter; import android.widget.SimpleCursorAdapter; public class Sprinter extends ListActivity { ...

Store data for songs MySQL DB

I'm storing a huge set of songs in a MySQL database. This is what I store in the 'songs' table: CREATE TABLE `songs` ( `song_id` int(10) unsigned NOT NULL auto_increment, `song_artist` varchar(255) NOT NULL, `song_track` varchar(255) NOT NULL, `song_mix` varchar(255) NOT NULL, `song_title` text NOT NULL, `song_hash` varchar(...

More efficient method for grabbing all child units

I have a table in SQL that links to itself through parentID. I want to find the children and their children and so forth until I find all the child objects. I have a recursive function that does this but it seems very ineffective. Is there a way to get sql to find all child objects? If so how? Using: Microsoft SQL Server Management St...