database

Running a sharded DB from a single machine

This sounds kinda dumb, but I have a sharded DB that I no longer think I need to run on 2 machines, and would like to run on one single machine instead. Any ideas on how that can potentially be done? There are lots of resources on how i can achieve the converse, but very little on how this can be done ...

IP address detection for geo-location or MAC address much secure?

Recent study many websites are using geo-location technology on their Websites. I'm planning to implement one website which can be detect the web visitor more accurate. An found that Mozilla is using some kind of detect MAC address technology in their Geo-Location web service. Is it violate some privacy issue? I believe most of Geo-loc...

Updating access 2000 database through code in VB6

I have an application that uses an access 2000 database currently in distribution. I need to update one of the recordsets with additional fields on my customer's computers. My data controls work fine as I have them set to connect in access 2000 format but when I try to open the database in code, I get an unrecognized data format error. W...

Staging database good practices

Hi, I'm about to deploy to production a fairly complex site and for the first time need a staging environment where I can test things in a more realistic environment, especially with regard to some external services that cannot be run locally. My general plan is to develop & test first locally, push simple changes (small bug fixes, HTM...

Common one-to-many table for multiple entities

Suppose I have two tables, Customer and Vendor. I want to have a common address table for customer and vendor addresses. Customers and Vendors can both have one to many addresses. Option 1 Add columns for the AddressID to the Customer and Vendor tables. This just doesn't seem like a clean solution to me. Customer Vendor ...

how to drilldown for some part of data...

I have 50 suppliers in the list..i have to show first 10 suppliers as normal and after that i have to put drill down option for remaining 40 suppliers.. Any answers please ...

Back up database by triggering entities in JPA?

Hi all, I have the following situation: I am using JPA to perform database activities. however, I want that after I made any changes to my entities and before I commit those changes, the current tables which are mapped to the current entities are automatically backed up so that I can keep my history data? Anyone has some ideas, please...

Differences between DB2 and Oracle

We had a talk with colleagues about databases yesterday as we will have a DB2 education in few weeks. I'm wondering, what are the differences between DB2 and Oracle as two major enterprise solutions? Are there any limitations in comparison to each other? Are there any tasks more suitable for DB2 or Oracle? (I found this article, but I s...

Is there a nice tool to convert gdbm file to sqlite database file?

Is there a nice tool to convert gdbm file to sqlite database file? ...

Saving tree-structures in Databases

Hello everyone. I use Hibernate/Spring and a MySQL Database for my data management. Currently I display a tree-structure in a JTable. A tree can have several branches, in turn a branch can have several branches (up to nine levels) again, or having leaves. Lately I have performanceproblemes, as soon as I want to create new branches on d...

How can I set my deployment options to script the incremental release of a Visual Studio 2010 database project?

I've just started using a VS2010 database project to manage the release of an update to an existing database. I want the deployment option to generate a script that will contain the commands to change my existing database rather than create an entirely new one. E.g I have 10 existing tables - one of which I drop in the new version and ...

Use the same database or replicate it for reports and web

I would like to know if i have a web with a huge Database and throw expensive (in time)reports , the best way to do this is with one database for the web and a replicated one for reports, or only one for both, i'm worried that users can throw reports for 5 or more years because they need that information and the web crashes because of th...

Use of unassigned local variable 'xxx'

I'm writing a database importer from our competitors to ours database:) I have a code generator which create Methods form import to our database like public void Test_Import_Customer_1() // variables string conn; string sqlSelect; string sqlInsert; int extID; string name; string name2; DateTime date_inserted; sqlSelect="sel...

Are document-oriented databases meant to replace relational databases?

Recently I've been working a little with MongoDB and I have to say I really like it. However it is a completely different type of database then I am used. I've noticed that it is most definitely better for certain types of data, however for heavily normalized databases it might not be the best choice. It appears to me however that it ...

Designing a data model in VS2010 and generating ORM code, application

Simply put: I have a database design in my head and I now want to use Visual Studio 2010 to create a WPF application. Key is to use the VS2010 tools to take much as possible manual work out of my hands. -The database engine is SQLite -ORM probably through DBLINQ -Use of LINQ -The application can create new, empty database instances ...

Simple DotNetNuke Database Access Example

Can someone provide a simple C# example of retrieving data from the database in the code behind of a DNN module? ...

How to count number of occurences for all different values in database column?

I have a Postgre database that has say 10 columns. The fifth column is called column5. There are 100 rows in the database and possible values of column5 are c5value1, c5value2, c5value3...c5value29, c5value30. I would like to print out a table that shows how many times each value occurs. So the table would look like this: Value(of col...

Migrating from hand-written persistence layer to ORM

Hi community, We are currently evaluating options for migrating from hand-written persistence layer to ORM. We have a bunch of legacy persistent objects (~200), that implement simple interface like this: interface JDBC { public long getId(); public void setId(long id); public void retrieve(); public void setDataSource(...

Duplicating table in MYSQL without copying one row at a time

Hi folks, I want to duplicate a very large table, but I do not want to copy it row by row. Is there a way to duplicate it? For example, you can TRUNCATE w/o deleting row/row, so i was wondering if there is something similar for copying entire tables UPDATE: row by row insert is very painful (because of 120M rows). Anyway to avoid that...

When to use a foreign key in MySQL

Is there official guidance or a threshold to indicate when it is best practice to use a foreign key in a MySQL database? Suppose you created a table for movies. One way to do it is to integrate the producer and director data into the same table. (movieID, movieName, directorName, producerName). However, suppose most directors and produ...