database

User Messages Database Schema?

This is probably very subjective and I have my own thoughts on this, but how would one go about constructing a database that supports user to user messages (one to one or one to many). My original thought was to have a MESSAGE table and MESSAGE_PARTIES table MESSAGE would include the following fields: -ID, Subject, Body, Create...

Cakephp looping through database saves, for some reason it only saves on the last instance of loop?

I'm trying to get this loop to save a new record to the database in cakephp on each iteration but for some reason its only saving it on the last one (so in this case it saves a record called "test9" but no others.. this type of save has worked for me so far in cakephp and I am completely stumped by this, I would appreciate any advice Th...

Spring and Mixing SQL and NoSQL db

The answers to my previous post encouraged me mixing SQL and NoSQL db. What is the best practice implementation of two databases in terms of application context configuration and DAO creation? Let's choose Derby as the SQL db and Cassandra as the other one. What I am searching for is e.g. an example appcontext.xml, two DAOs, one imple...

Database design for a social networking site...

What are the Tables that would be present in a social networking site (ex:twitter).... I have a users table as of now... How to keep tracker of followers and people i follow... Should i maintain separate table for followers and people i follow... What are the columns which would be there in those tables? Please don't think this as Su...

How to create a DBAdapter object in inner class extends BaseExpandableListAdapter?

Hello there, I want to populate ExpandableListView from database. But I can't create the DBAdapter object in class extends BaseExpandableListAdapter, because I don't know what context must be passed to DBAdapter constructor. I use DBAdapter db = new DBAdapter(AutoContacts.this); but it doesn't work. Here my code: Autocontact.java import...

GUID as uniq key with SQLite

I found GUID generation routine with python. Running the code gives me the following results. GUID: 00000129e0e72d9b2aab3c1500ac001000e90001 Time: Sat, 17 Jul 2010 09:55:33 (millis: 0.787) IP: 172.16.233.1 Counter: 715865109 The comments of this code has the following message. ### GUIDs make wonderful databas...

Values stored using ContentValues are not in correct order, WHY???

Hi all, currently I'm working on my 1st Android app and I encounter something I cannot solve. When I try to insert data into my own database there is an error: 07-18 03:41:04.414: ERROR/AndroidRuntime(3480): java.lang.NullPointerException My code for inserting into table is: public long createRecord(String created_time, String modifie...

Wordpress Database Import

I just imported my Wordpress database from a localhost installation on my computer to the online server. However, all the links still point to localhost instead of the server's url. Is there something extra I forgot to do? (Note: I did not hard write my links so for example the navigation which still points to localhost is generated w...

Save Username & Pass Objective C iPhone

i have a textfield, Number and Password i have no clue how to save these settings and then read them as the app starts to check if they have been set or not. Thanks Mason ...

Cakephp, retrieve only certain number of rows from database?

I don't know if I'm missing something, or what, but I've been looking over the cakephp cookbook a lot lately and I don't think I have figured a way from it to get "x" number of rows (say 100) based on criteria.. right now I'm just using the find method to get all rows and then using my php controller to make use of only the ones I need, ...

In the database, why can't we just use "Long" integers for dates (millis since epoch)

I would like to use a Long datatype in the database to represent dates (as millis since epoch). The reason why, is that storing dates is so complex with the jdbc driver and Oracle engine. If you submit the wrong datatype in preparedStatement it casts a timestamp to a date (or vice versa) blowing your index, resulting in full table scans ...

Simple Game Server

I'm looking for a simple game server for an iPhone game I'm creating. The game is turn based, so I just need a way for players to find other players, and then have the server gather and send out turns. It's a simple two player card game. If you have ever seem the with friends app.. ( Chess with friends, Words with friends ) that is th...

How to store multiple sets of values in a database?

Right now I'm creating a web-app which requires that multiple sets of data (including a URL, title, and date) be stored in a DB. So for example, User1 may be storing Item 1 which consists of Example, http://example.com, and YY-MM-DD HH:MM:SS. And he may have multiple items with the same types of data. Before, I was sotring all the item...

Displaying multiple values from same name MySQL database field in Codeigniter & Dwoo

I am building a web application and have opted to use similar table and field names to Wordpress in my application. By that I mean I have a users table and a usermeta table similar to how Wordpress works. Forgive me for making this question so big, I opted to be as descriptive as possible in this question. The usermeta table has the fo...

How do I do this with Django objects.filter?

MYTable.objects.filter( where id = 42, 55, 65, and 55) and it returns a query set ? ...

Entity framework model creation

When using the Entity Framework there are basically two ways to create your model. You either create the model in SQL server or in Visual Studio EF designer. Those are outlined below. Start with Database You first create the model in your SQL server DB then point EF to create the .edmx file for you. By using this approach you can use ...

adding up values of two textboxes and putting the computed value into the database

I am creating an application which has 3 text boxes, the user inputs two integer values and then 3rd text box is a readonly box and is meant to contain the sum of the two input values. all these input values are then supposed to be adding to their corresponding fields int he database table. Can some one help show me the code that can im...

Opening adt , adi and adm files

Hi All, I am developing a web application and I have a folder containing a bunch of files with .adm , .adi and .adt and .bak extensions.I want to be able to read this data and convert put it in mysql db. I have figured that these are files stored by sybase in its proprietary format. I have opening with sybase advantage server but the fo...

CakePHP, injects "LEFT JOIN" (mentioning fields in an associated model) into my update attempts

This is driving me crazy, I am trying to do something like: $this->data = $this->Prox->read('proxy',$currentgetdata); $this->data['Prox']['checked'] = 2; $this->Prox->save(); where I have a model association of: class Prox extends AppModel { var $name = 'Prox'; var $primaryKey = 'id'; ...

Recover data from a DB2 backup ( a diff of databases would be great!)

Time line: 1_ Made backup of database 2_ Deleted a row from table that deleted +100 others records in other tables since they where with the constrait ON DELETE CASCADE. 3_ Made backup of database 4_ Made a lot valid of updates/deletes/inserts. 5_ Need to recover the data lost in 2 I've seen the rollforward db2 command, but it's n...