database

How to query range of data in DB2 with highest performance?

Usually, I need to retrieve data from a table in some range; for example, a separate page for each search result. In MySQL I use LIMIT keyword but in DB2 I don't know. Now I use this query for retrieve range of data. SELECT * FROM( SELECT SMALLINT(RANK() OVER(ORDER BY NAME DESC)) AS RUNNING_NO , DATA_KEY_VALUE , ...

How do you prevent time zone translation on a SqlConnection?

Hi, I've got a database here that runs entirely on GMT. The client machines, however, may run on many different time zones (including BST). When you pull data back using SqlConnection, it will translate the datetime value so, for instance 19 August 2008 becomes 18 August 2008 23:00:00. My question is, is there a way to specify to t...

SQL design around lack of cross-database foreign key references

For better or worse, we have a solution that relies on multiple databases that all reference a common administration database. Databases ship as part of modules, and not all modules are required for an installation (probably why we have multiple databases in the first place). The admin database is required, however ... so it will alway...

Indexing Multiple Tables in Lucene

I want to use lucene.net to index records in our database. The records are stored in several different tables and tied together through a records table. Would it be better to index each table separately and tie the search results together in code, or should I tie the records together coming out of the database and place them all in one...

.NET - Users and different databases

Hello all, I'm looking at having certain users access one database and other users accessing another database based on the company they belong to. What would be the best way to handle the connection strings and make sure the user connects to the right db when they login? Thanks for any ideas. ...

How do I unit test jdbc code in java?

I'd like to write some unit tests for some code that connects to a database, runs one or more queries, and then processes the results. (Without actually using a database) Another developer here wrote our own DataSource, Connection, Statement, PreparedStatement, and ResultSet implementation that will return the corresponding objects base...

Is it possible to query the @@DBTS on a database other than the current database?

For a rigorous marker of the source database state, I'd like to capture the @@DBTS of an external database in a sproc. Yeah, I think I could issue USE ExternalDB GO SELECT @myVarbinary8 = @@DBTS GO USE OriginalDB GO but, even if I could, it seems ugly. For now, I've embedded a scalar-valued function in the source database to i...

What's the best database framework for PHP?

After graduating from calling the mysql_* functions directly in my code, I've stepped up to a home-brewed database abstraction class. Now, I'm beginning to think that I should really use a "professional" DB class instead. I know there are a lot of them out there (ADODB, PDO, MDB2, etc) but I want to know which one I should try out. What...

Best way to view a table with *lots* of columns?

At the risk of being downmodded, I want to ask what the best mechanism (best is obviously subjective for the practice violation inherent here) for viewing data from a table, using C#, with a lot of columns. By a lot, I mean something like 1000. Now before you get all click happy, or throw out responses like "why the hell would you ever...

Session management using Hibernate in a Swing application

How do you do your Hibernate session management in a Java Desktop Swing application? Do you use a single session? Multiple sessions? Here are a few references on the subject: http://www.hibernate.org/333.html http://blog.schauderhaft.de/2008/09/28/hibernate-sessions-in-two-tier-rich-client-applications/ http://in.relation.to/Bloggers...

Is there a type of report or cross-tab that would display this data elegantly?

I have data in this form, Article ID Company A Company B Company C 1 Featured Mentioned -- 2 Mentioned Featured Mentioned 3 Mentioned -- -- 4 Featured Mentioned Mentioned 5 Mentioned Mentioned Featured I’d like to show, for example, how many times Company B was...

Connection pooling in asp.net

I´ve been looking for it yet in stackoverflow without success... Is it posible a connection pooling in asp.net? Is it worthwhile? How? ...

MySQL and SQL Server for same application.

What are good ways of achieving this DB agnosticism without actually coding two DAL's? I've heard that the Data Access Application Block is suitable for this. ...

Can anyone recommend a good SQL parsers?

I am trying to write a tool that can compare a database’s schema to the SQL in an install script. Getting the information from the database is pretty straightforward but I am having a little trouble parsing the install scripts. I have played with a few of the parsers that show up on Google but they seemed somewhat incomplete. Ideall...

How can I Cause a Deadlock in MySQL for Testing Purposes

I want to make my Python library working with MySQLdb be able to detect deadlocks and try again. I believe I've coded a good solution, and now I want to test it. Any ideas for the simplest queries I could run using MySQLdb to create a deadlock condition would be? system info: MySQL 5.0.19 Client 5.1.11 Windows XP Python 2.4 / MySQ...

Deleting from a database map

I have these 3 tables + data: items: itemId, itemName data: 1, my item one categories: catId, catName data: 1, my cat one. 2, my cat two map: mapId, itemId, catId When you include item "my item one" in category "my cat one", you insert [1, 1, 1] into the map. When you add "my item one" to "my cat two", you insert [2, 1, 2] into the m...

Import a Oracle DMP file into a Fresh install of oracle

A client sent us a oracle database we need to test against. We don't use oracle or have any oracle expertise in house. We need to setup the database so we can connect to it and debug a problem. I did a fresh install of oracle 9 (the version the client is running) and the management tools. I cannot for the life of me get it to import t...

non relational databases : need a recommendation

Hi All, I have found relational database options, but I want to see if there are any faster non-relational databases that could do better. I am storing up to 32 GB of these records which contain 3 ints, a byte[8] array (or binary(8)), and a double. I will RARELY RARELY query the database, but I need to make sure that if I do read fr...

Lightweight SQL database which doesn't require installation

Could you recommend me, please, lightweight SQL database which doesn't require installation on a client computer to work and could be accessed easily from .NET application? Only basic SQL capabilities are needed. Now I am using Access database in simple projects and distribute .MDB and .EXE files together. Looking for any alternatives. ...

Strategy for Offline/Online data synchronization

My requirement is I have server J2EE web application and client J2EE web application. Sometimes client can go offline. When client comes online he should be able to synchronize changes to and fro. Also I should be able to control which rows/tables need to be synchronized based on some filters/rules. Is there any existing Java frameworks ...