database

Why am I getting this UnicodeEncodeError when I am inserting into the MySQL database?

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 2: ordinal not in range(128) I changed my database default to be utf-8, and not "latin"....but this error still occurs. why? This is in my.cnf. Am I doing this wrong? I just want EVERYTHING TO BE UTF-8. init_connect='SET collation_connection = utf8_general_c...

Correct way to safely store token/secret/etc from OAuth?

I just started looking into OAuth and it looks really nice. I have oauth with twitter working in ruby right now. Now I'm wondering, what is the recommended safe way to store the responses in my local database and session? What should I store? Where should I store it? This example twitter-oauth-with-rails app stores a user.id in the...

Django: Serializing models in a nested data structure?

It's easy to serialize models in an iterable: def _toJSON(models): return serializers.serialize("json", models, ensure_ascii=False) What about when I have something more complicated: [ (Model_A_1, [Model_B_1, Model_B_2, Model_B_3]), (Model_A_2, [Model_B_3, Model_B_4, Model_B_5, Model_B_59]), (Model_A_3, [Model_B_6, Model_B_7]), ]...

Appending data to a MySQL database field that already has data in it.

I need to "add" data to a field that already contains data without erasing whats currently there. For example if the field contains HTML, I need to add additional HTML to the field. Is there a SQL call that will do this or do I need to call the data in that field, concatenate the new data to the existing data, and reload it into the d...

DbMetal chokes on repeated foreign key references in SQLite - any ideas?

I've been struggling to get DbMetal to process my SQLite database. I finally isolated the problem. It won't allow a table to have two foreign key references to the same column. For example, a SQLite database with these two tables will fail: CREATE TABLE Person ( Id INTEGER PRIMARY KEY, Name TEXT NOT NULL ); CREATE TABLE Match ...

ADO.NET: Faster way to check if the database server is accessible?

At the moment I am using this code to check if the database is accessible: public bool IsDatabaseOnline(string con) { bool isConnected = false; SQLConnection connect = null; try { connect = new SQLConnection(con); connect.Open(); isConnected = true; } catch (Exception e) { isConnected = ...

sqlite database opens fine on the iPhone simulator, but not on the device

Why would this run fine on the iPhone simulator... but the database can't be opened on an iPhone device? sqlite3 *g_Db = nil; BOOL OpenDatabase(NSString *databaseName) { if(sqlite3_open([databaseName UTF8String], &g_Db) == SQLITE_OK) { NSLog(@"Opened db ok"); return(YES); } else { NSLog(@"Can...

How to develop for iphone application about "retrieving database file on web"?

Hi...all experts! I'm a newbie to iphone developer. Well, currently, I'm developing iphone for Location Based Service. That application need to have these functions. 1. hierarchical tree-view on navigation bar. 2. list up page 3. detail page for example, Let's say. I have top category like "Restaurant, Hotel, Gift Shop" Second leve...

Looking for books

When I was learning Visual Basic.net 2008 I found a book that not only taught the basics but by the end of the book I had developed a fully working database application. Does anyone know where I might find a simular book but using Visual C++? ...

visual c# 2008 database application examples

hi, i just have a few weeks programming with vc# (2008) and i'm trying to build an application (winforms) and i have the following problem... i need my application to work with and without connection to the mssql database, this sounds like piece of cake for our friend DataSet right? i can persist the data as XML or binary until i can re...

split a database web application - good idea or bad idea?

split a database web application - good idea or bad idea? Application1 uses database1 on ServerX Application2 uses database2 on ServerY Both application communicates over web service API, they are apart of the same application, one application is used to manage user's profile/personal data, while the other application is used to ma...

Why do we need Audit Columns in Database Tables?

Hi I have seen many database designs having following audit columns on all the tables... Created By Create DateTime Updated By Upldated DateTime From one perspective I see tables from the following view... Entity Tables: Good candidate for Audit columns) Reference Tables: Audit columns may or may not required. In some case last...

ASP.NET MVC Membership DB must be merged with site DB?

I am planning to use ASP.NET MVC2 implemented membership system to manage users. Database that uses application should have tables that are related with these users. Is it possible to use two different databases and make relationships (foreign keys) between them or I will have to merge these two databases into one? Thanks, Ile ...

Does the Quick Search Box search the database in Android? how?

i have an database with the values of latitude and longitude. i would need to search those values depends on the user input. does the quick search box can search only the database value with the type-to-search feature. Else i want to put a separate EditText and then do the the search process.. if QSB is possible then how to do that? i wa...

How do you unit test your T-SQL

How do you unit test your T-SQL? Which libraries/tools do you use? What percentage of your code is covered by unit tests and how do you measure it? How do you decide which modules to unit test first? Do you think the time and effort which you invested in your unit testing harness has paid off or not? If you do not use unit testing, ca...

Is there any reason I shouldn't do database calls from the destructor?

I want to create a sort of datamapper library, where you'd do something like this: $users = Users::getTable(); $users->add($newUser1); $users->add($newUser2); Now $users contains 2 user records, but they aren't yet persisted to the database. To be efficient, I'd like to flush them all at once. I would like to have a flush() method to ...

Store data in Ruby on Rails without Database

I have a few data values that I need to store on my rails app and wanted to know if there are any alternatives to creating a database table just to do this simple task. Background: I'm writing some analytics and dashboard tools for my ruby on rails app and i'm hoping to speed up the dashboard by caching results that will never change. ...

Oracle row change time stamp

Is there a system column - timestamp - in Oracle table to determine when was it changed last time? I would assume there must be one to let mat views pull changes only ... ...

Cursor returns zero rows from query to table

I've created an SQLiteDatabase in my app and populated it with some data. I can connect to my AVD with a terminal and when I issue select * from articles; I get a list of all the rows in my table and everything looks fine. However, in my code when I query my table, I get a cursor back that has my tables columns, but zero rows of data. ...

Social Networking & Network Affiliations

Hi. I am in the process of planning a database for a social networking project and stumbled upon this url which is a (crude) reverse engineered guess at facebook's schema: http://www.flickr.com/photos/ikhnaton2/533233247/ What is of interest to me is the notion of "Affiliations" and I am trying to fully understand how they work, ...