database

How to do "select current_timestamp" in hsqldb?

Oracle: select systimestamp from dual MySQL: select current_timestamp SQL Server: select current_timestamp PostgreSQL: select current_timestamp The question is, how can I get the current timestamp in HSQLDB? I use version 1.8.0.10 ...

Suggestions for Security Design for Access Control List in database?

I have users for my application with access control list (these are both tables/schema/objects). Currently these are read from the database, Boolean values are used to indicate what they can view/manipulate. However, anyone can still go to the database and change the data. Can someone offer some suggestion on what kind of things I can do...

How do I connect to an Access database over a LAN using Java?

Do you know of any good guides on how to access an Access database using Java? I know the basics and basic SQL, but I'm thinking more about access control. ...

More elegant SQL?

Hi, The query below is perfectly functional, and queries a single table to find the last 50 usernames added via a sequential userid number column. Logic so far is to: find out the highest userid; subtract 50 from that; pull usernames back where greater. However, it doesn't look elegant, and uses two subqueries to achieve it's goal: ...

How many megabytes per day are two nibbles per nanosecond?

One of my tables in my SQL database has a growth rate of two nibbles per nanosecond. I was wondering how many megabytes per day that is and should I be worried? My hard disk is 150 GB. ...

Why do associated collections contain null values? (Hibernate, Annotation, Spring)

[Edit: Apparently, this is only an issue for arrays and FoxyBOA's answer might direct to (or even is) the answer.] Hi, my question relates to these software: Hibernate3+Annotation, Spring MVC, MySQL and in this example also Spring Security. I was wondering, why collections, which are automatically associated by Hibernate contain null v...

Moving away from STI - SQL to break single table into new multi-table structure

I am moving old project that used single table inheritance in to a new database, which is more structured. How would I write a SQL script to port this? Old structure I've simplified the SQL for legibility. CREATE TABLE customers ( id int(11), ... firstName varchar(50), surname varchar(50), address1 varchar(50), address2 v...

sqlite as a production database for a low-traffic site?

I'm considering using sqlite as a production database for a site that would receive perhaps 20 simultaneous users but with the potential for a peak that could be many multiples of that (since the site would be accessible on the open internet and there's always a possibility that someone will post a link somewhere that could drive many pe...

Where is this Rails file stored? db/development.sqlite3

I'm trying to find the sqlite database file that rails creates. Sorry if this is a dumb question but which folder is this file stored in? I've looked in all of the folders in my Rails project and can't find it. My database.yml: development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout...

MySql Group by

Hi all so I have the following table, 't1' id r_id o_id count 1 2 100 1 2 3 100 1 3 5 100 1 4 2 101 2 5 3 101 2 6 4 101 2 What I'm trying to do is, for a given list of r_id's, return the r_id and o_id where the count...

Is it possible to create a database using NHibernate?

I am using NHibernate with FluentNHibernate for my DAL. I am also using SchemaExport and/or SchemaUpdate to create and update my database schema. My problem is that the schema operations all require the database to exist before they will work. I want to programmatically create my database and update the schema as there may be multiple d...

Create a Supercedes Condition in Entity Framework

As the title of the question states... I've got a database that is using a supercedes model to store information... meaning that each time a customer is edited, instead of updating the row, the software simply slams a new record into the database, and then updates the old records to have a pointer to this new record. I was trying to dra...

Making my SSIS package portable - how to do this?

I know how to create SSIS packages and getting my data source and destinations. But what will i have to do in my package if i want to make it portable in the sense where i can change the source and destination connection strings when i move my package onto another PC? Thanks in advanced! ...

Database connection pooling datastructure

I would like to develop database connection pooling. Could anyone please tell me about which data structure need to use to maintain the pool ? ...

Regular expressions in JDBC

I have a java-application using JDBC for database interaction. I want to do a search based on a series of regular-expressions, however the application should be generic, we do not know if the database-engine will by mysql,oracle,sql server etc, but we are pretty sure it's gonna be either mysql or oracle. Will regular-expressions limit m...

Hierarchical Data Models: Adjacency List vs. Nested Sets

I have a product catalog. Each category consists of different number (in deep) of subcategories. The number of levels (deep) is unknown, but I quite sure that it will not be exceed of 5,6 levels. The data changes are much more rarely then reads. The question is: what type of hierarchical data model is more suitable for such situation. T...

What are some good Oracle Db maintenance Tools.

We have grown from a small time of 2-3 developers to about 30 developers very quickly. We supposedly never needed Source Control, or Db Monitoring or Schema diagrams. Now we see more and more terrible code being moved to the Production. Is there an off the shelf product for oracle that will help manage version control and deployment ma...

What are the pros/cons of and best practices for using a single database?

Here at work (a multi-billion dollar manufaturing company with a 12 person Windows development team) we are about to go to a single master database for all new applications and will have it broken up with schemas for what we normally would have had databases for before. There will also be a few common schemas with stuff like employee dir...

database model structure

Hi all, I have a column groups. Groups has different type stored in group_types (buyers, sellers, referee). Only when the group is of type buyer it has another type (more specialized) like electrical and mechanical. I'm a bit puzzled with how I will store this in a database. Someone can suggest me a database structure? thanks ...

Contact Management System Schema

I'm looking for something I can reference in designing the database for a contact management system. Any suggestions? ...