database

information_schema.columns on sqlite

I would like to do a query like next: SELECT table_name, column_name, data_type, is_nullable, ... FROM information_schema.columns on a sqlite database. I checked PRAGMA table_info(table_name); but doesn't suit my needs, just check fields for one table. I checked select * from sqlite_master where type = 'table'; But this jus...

Java, Code Generation, and Persistence Frameworks

Are there any Java code generation persistence frameworks? Something that is "database first" rather than object model first? I know this is probably heresy in the Java world, I'd just like to know if any frameworks like this exist. I'm more of a .NET guy these days. So on the .NET-side tools like .NET Tiers or CSLA come to mind. ...

Better to use two columns or DATETIME

I'm working on a MySQL database which will create a "Today at" list and send it to subscribers. I'm wondering if it's better to use the DATETIME data type on the start and end fields, or two have two columns, startDate and startTime (with the appropriate data types). My first thought was to use DATETIME, but that makes subsequent use of ...

What are the disadvantages of having many indices?

I recently sped up a complicated query by an order of magnitude by giving SQLite a good index to work with. Results like this make me wonder if I should index a lot of other fields that are commonly used for JOINs or ORDER BY clauses. But I don't want to get overzealous and have it backfire on me: I assume there must be some reasons not ...

SQLite Performance Benchmark -- why is :memory: so slow...only 1.5X as fast as disk?

Why is :memory: in sqlite so slow? I've been trying to see if there are any performance improvements gained by using in-memory sqlite vs. disk based sqlite. Basically I'd like to trade startup time and memory to get extremely rapid queries which do not hit disk during the course of the application. However, the following benchmark giv...

binary format to pass tabular data

I'm maintaining a legacy embedded device which interacts with the real world. Generally speaking, this device collects data from sensors, processes the data using its internal algorithm, and displays warning when data reaches a certain "bad" state. For debugging purposes, we wish this device will send us on a regular basis many of the d...

Get perforce data into a .NET application

Hi all. I'm curious as if anyone has used any method of getting data from perforce into a managed language. I've found a few sample applications out there, and I'm hoping someone here has had success in doing this and could offer some advice. Thanks! ...

What's a good resource for grokking database connection strings?

Often the most frustrating thing in starting a new database project or learning a new database is figuring out the magic incantation known as the "connection string". Where are the good resources for understanding each database's connection string format? ...

C# - Serializing vs Database

Hi Guys, I belive that the best way to save your application state is to a traditional relational database which most of the time its table structure is pretty much represent the data model of our system + meta data. However other guys in my team think that today its best simply serialize the entire object graph to a binary or xml file. ...

SQL trigger question: why is this a syntax error?

I would to create a trigger for Sybase, but it shows an error. What I want to do is, when a delete operation is done on the [student] table, to check whether there is any record related to student on [account], and if so, raise an exception. There seems to be a lack of support by Sybase. Their official seem not people to visit. *CREAT...

Best Relational DataBase Representation Of Time Bound Hierarchies

What in everyone's opinion is the best representation for a time-bound hierarchy in SQL? What I mean by this is: - On any given date you have a normal tree hierarchy - This hierarchy can change from day to date - Each child still only has one parent on any given date Day 1... Business | |-Joe | |-Happy | |-Sneezy | |-Doc(*) ...

fast local database

i have a desktop application that talks soap to a server. the communication is very slow so i want to download a lot of the data up front and query from my local database. i wan this local data to persist after the application shuts down so what is the best way for doing this . . . are there any good products / examples to do this . . ...

store image in database or in a system file ?

Exact Duplicate: User Images: Database or filesystem storage? Exact Duplicate: Storing images in database: Yea or nay? Exact Duplicate: Should I store my images in the database or folders? Exact Duplicate: Would you store binary data in database or folders? Exact Duplicate: Store pictures as files or or the database for a web app? Exact ...

How do I get the highest currently used ID number in a table with LINQ?

I have a table with a list of names. This table has an ID column that is an autoincremented number. I would like to display on my website something like, "6,523,213 names created so far." So, I need to get the highest currently index/ID number from my names table. I can think of a few ways to do it, I could OrderBy ID by desc and se...

PHP/MYSQL - Pushing it to the limit?

I've been coding php for a while now and have a pretty firm grip on it, MySQL, well, lets just say I can make it work. I'd like to make a stats script to track the stats of other websites similar to the obvious statcounter, google analytics, mint, etc. I, of course, would like to code this properly and I don't see MySQL liking 20,000,0...

How to gain performance when maintaining historical and current data?

I want to maintain last ten years of stock market data in a single table. Certain analysis need only data of the last one month data. When I do this short term analysis it takes a long time to complete the operation. To overcome this I created another table to hold current year data alone. When I perform the analysis from this table it...

Simple MySQL database question

Hi, I'm very new to databases and I have a quick question. How would I design my MySQL database if I have these fields: ID, lat, long, date - multiple dates, time - multiple times I know I should put it into two tables, right? And how would those two tables look? Thanks! ...

Hibernate and no PK

Is it possible to create a table (from a JPA annotated hibernate entity) that does not contain a primary key / Id? (I know this is not a good idea. A table should have a primay key.) ...

Database Migration

I am working on database migration tool in java. The tool is copying database tables with their data's to the destination database. But i want it to work on different databases. Copy from mysql and create in derby etc. With JDBC, we can gather enough information about the table and its columns. But i am going to ask this, if i can recrea...

Maintaining a database externally in a text file

hi all, What is the simplest way of maintaining a txt based database file that allows the program the write in new or edit existing entry during execution time. to be specific, the program must be capable of storing a client, ip and port when it logs in, and remove accordingly when the client logs out, without using "internal" approac...