database

Handling DataAccessException for Spring JDBC

I am using a Datasource to log my audit information per user-request. The bean is defined in a springContext.xml sourced during initialization. Whenever the DB is down, the bean initialization fails with following error: DataAccessException. What I want to do is continue after this exception(since it is ok not to be able to log). How d...

mysql content fields idea :)

I try new table structure for our new eccomemrce website like Wordpress tables. But I am not sure whether it's really good idea for performance. We've just 2 tables for products and other contents (such us pages, attachments, or even orders). Their ordinary fields kept first table (such as ID, title,date), but their special fields kept ...

BasicDataSource close() method does not close connections

Hello all, I have a short script opening datasource and then closing it. This script is using BasicDataSource. BasicDataSource bds = new BasicDataSource(); bds.setDriverClassName("com.mysql.jdbc.Driver"); bds.setUrl("jdbc:mysql://10.1.1.186:3306/logs"); bds.setUsername("root"); bds.setPassword(""); Connection connection = bds.getConnec...

Hibernate custom identifier generattion

Hi, I am now using hibernate as ORM technique in my application. I have a table called Order and I want the hibernate to generates the ID for each instance when inserting new order into the table. Quite unusual, the desired auto-generated id should be something like this: first time: jialhe001 and then jialhe002 .... jialhe003, jialhe0...

which keyvalue store has the best performance?

I think tow months ago. I found a google's open source project that can store key value pairs with high performance. But i forget the name. Could anybody tell me? or you can have some other suggestions for me? I have been using BerkerlyDB, but I found BerkerlyDb is not fast enough for my program. However, berkerylyDB is convenient to use...

SSAS - Facts that happened over a time range

Hi, I don't really know how to handle facts that happened over a period of time. I sually deal with facts that happened on a specific date. In clear, my facts have a start_date and an end_date. So, let's say my start_date is 01/01/2008 and my end_date is 01/01/2011. I need to get the number of those facts that happened in 2009 and thos...

Eclipselink: modifying the deploy.xml and entities using java code

I have built several applications using Eclipselink and the EL Workbench to generate entity files and all necessary configuration as a deploy.xml file. For my next project, I would like to be able to modify the deploy.xml at runtime, using some sort of XML API, and be able to generate the revised entity files and ideally manipulate the ...

Does SQL Server guarantee accurate data storage? If so, how?

This question is specific to SQL Server, but other DB replies welcome. Read below for some history. My short question is, how does SQL Server guarantee that when I request "ABCDE" to be written to the database, that "ABCDE" is written, not "ABECD"? It has been suggested that data be re-read and compared to guarantee the same results, wi...

How important is database normalization in a very simple database?

I am making a very simple database (mysql) with essentially two types of data, always with a 1 to 1 relationship: Events Sponsor Time (Optional) Location (City, State) Venue (Optional) Details URL Sponsors Name URL Cities will be duplicated often, but is there really much value in having a cities table for such a simple databa...

django manual database migration

Hi all, I am preferring to manually migrate my tables in Django. Because using automated tools puts me in a place where I cannot see the impact. With impact, I mean the the time it takes the db get in synch with my models. Below is a simple example: class User(models.Model): first_name = CharField(..) Let's say I want to add this:...

Best Database selection for Client/Server Application (Multiuser) with Delphi?

Hi all, i want to code a software with Delphi XE, that will be able to connect to a server and users should be able to read/write the database. All records will be string (unicode enabled), maybe small amount of it can be blob. My needs are; Multiple users enabled More than one user should be able add new records at one time Capable of...

copy one field from table to another field in the same table

I used this query to copy one full column from the same table: UPDATE 'content_type_chapter' SET 'field_chapternumbersort2_value' = 'field_chapternumbersort_value' But I have received this error. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use nea...

Remove record from a datatable when record disappears from a mirrored datatable

I have two mirrored datatables (same structure with two primary keys) : DataTable_A ---> bound to a datagridView DataTable_B ---> filled from a database Since DataTable_B is filled by a query into database every 2 seconds, I need to mirror the DataTable_A like DataTable_B avoiding filling directly DataTable_A. When a record disappea...

How to get data from server and update the database with it ?

I am implementing an android application and i can't figure out how to solve this problem : When user clicks to the update button , i want to connect to the my server and check if there is any update on the data , if there is , i want to get data from server and update the database.Should i use xml structure to check and get updates from...

C# system.io.filenotfoundexception

I am creating an app for my work to track behavior management over the course of a school year. To do this, I obviously needed a database. I built the program so that it would, when opened, check to see if the database exists, and if it doesn't, it creates one, and inputs the schema. This works perfectly on my dev computer, but when I ...

Efficient database query for ancestors on an acyclic directed graph

Let's say I have an acyclic directed graph such as a family "tree" (not really a tree since a child has 2 parents). I want to place a representation of this graph in a relational database so that it's fast to compute all ancestors of a node, and all descendants of a node. How would you represent this graph? How would you query for all de...

Is there a command to search for a string within all man pages installed in the man-db

I know that if I can't remember a command I can just look it up on Google. But this should be possible from the shell itself. If I could output all the man-pages, I could run a grep on them and find what I was looking for. Is there a simple command line man-search-engine out there that indexes all the words in all the man pages and let...

MySql PRIMARY KEY other than an int

Im bulding a site that pulls links from twitter and counts the results from it. Ive been thinking about using the actual URL as the PRIMARY KEY instead of using an auto_increment integer. The url's being pulled will be unique and related to trend tracking. Is this a bad idea and should i stick with an integer? ...

Does a simple document-based database exist?

Is there a database out there that I can use for a really basic project that stores the schema in terms of documents representing an individual database table? For example, if I have a schema made up of 5 tables (one, two, three, four and five), then the database would be made up of 5 documents in some sort of "simple" encoding (e.g. ...

Acceptable length of url to be stored as unique MySql/PHP

I want to store url's as unique in a mysql database table but with string type varchar and text the length of a 1000 is too long. Lengths of Search engine friendly url's can be typically long,whats an acceptable length? ...