database

Table Details in SQL Anywhere?

I just downloaded the developer edition of SQL Anywhere. How can I get a list of tables in the database I'm connected to?. Also for a particular table, how do I get the meta-data for that table (column names, types, etc)? ...

MySQL vs PostgreSQL? Which should I choose for my Django project?

My Django project is going to be backed by a large database with several hundred thousand entries, and will need to support searching (I'll probably end up using djangosearch or a similar project.) Which database backend is best suited to my project and why? Can you recommend any good resources for further reading? ...

How can I set isolation levels per method in EJB 3

Is it possible to set the database isolation level (ie Serializable, repeatable-read etc) for a given EJB 3 method call? I understand that this is not covered by the EJB Spec, so details of how to do it on either a JBoss or Glassfish specific manner would be great. I'm starting to get the impression it's not possible and that you can o...

MySQL not using indexes with WHERE IN clause?

I'm trying to optimize some of the database queries in my Rails app and I have several that have got me stumped. They are all using an IN in the WHERE clause and are all doing full table scans even though an appropriate index appears to be in place. For example: SELECT `user_metrics`.* FROM `user_metrics` WHERE (`user_metrics`.user_id...

Any good spatial database tutorials out there?

I was looking to explore the spatial capabilities of PostGIS or SQL Server 2008. Maybe Oracle as well. I was wondering if there are any good tutorials out there exploring the spatial capabilities of these database in particular or of this type of capability in general. Does anyone know of any? Book recommendations would work as well. ...

What's the best way for the client app to immediately react to an update in the database?

What is the best way to program an immediate reaction to an update to data in a database? The simplest method I could think of offhand is a thread that checks the database for a particular change to some data and continually waits to check it again for some predefined length of time. This solution seems to be wasteful and suboptimal to ...

Inserting an object to the db using hibernate, only if it doesn't exist

Let's say I have a mapped User object with a user_id as a primary key, and a mail column with a unique constraint. I want my program to save a User object to the users table only if it doesn't exist. I can do the following thing in my insert function: begin transaction query for a user with the given mail if it doesn't exist, create a...

Database Disk Queue too high, what can be done?

I have a problem with a large database I am working with which resides on a single drive - this Database contains around a dozen tables with the two main ones are around 1GB each which cannot be made smaller. My problem is the disk queue for the database drive is around 96% to 100% even when the website that uses the DB is idle. What op...

Is using a Java Datasource an expensive ordeal?

My Java (non-Web) application may have to create Connection Pools of about 200 different Datasources. Yes, all 200 of them connecting to different Databases. Not 200 connections in the pool. Here are some questions that are bugging me.. 1) Should I anticipate major (performance etc. issues? 2) Are there any Non-commercial Java tools ...

C# multiple connections vs Dataset

Hi I use C# and SQL Server 2005 and I need a recommendation on how to populate my objects. I have a Customers collection containing a collection of customer objects. Each customer object contains a Orders collection, containing a collection of orders. I use a public Fetch() method on my Customers collection to populate the customers a...

How varbinary data column to string using safedatareader?

I has a data type varbinay in database. I need to fetch it from database using csla.Datareader.safedatareader into string. ...

Deciding between an artificial primary key and a natural key for a Products table

Basically, I will need to combine product data from multiple vendors into a single database (it's more complex than that, of course) which has several tables that will need to be joined together for most OLTP operations. I was going to stick with the default and use an auto-incrementing integer as the primary key, but while one vendor s...

.NET Unit Tests for Reading/Saving data to database

Most things I read about Unit Tests is about testing your classes and their behaviour. But how do you test saving data to a database and reading data from a database. In our project saving and reading data is done through services that are used by a Flex Application (using WebORB as a gateway). For instance, a service reads all users tha...

problem with Web.config wiring a database

<connectionStrings> <add name ="MyDB" connectionString ="Data Source=.\SQLEXPRESS" providerName="System.Data.SqlClient"/> </connectionStrings> I've wired the above however I keep getting the following: System.Configuration.ConfigurationErrorsException: The requested database MyDb is not defined in configuration. Is there s...

Handling abnormal Java program exits

Hello all, Suppose I have a Java application that opens a database connection. Normally I would add a connection.close() in a finally block, but this block wouldn't be executed in the case of a kill operation, or any other abnormal termination, would it? Are there any other precautions that I, as a programmer, can make in order to close...

How do I join two tables from two different databases?

Is there any way to use a query and join two tables that is in two different database on the same server for DbVisualizer? I used the following for the SQL server Select * from table union select * from datbase.dbo.table2 I tried this for the DbVisualizer, and it didnt work. How do I do this? ...

How to better import/export XML to Database, having XML with schema?

Do you know best practicies ? ...

Setting Crystal Report data source at runtime

Hi there guys. When creating my Crystal Report I obviously set up a database and server connection that I use for development. What I want to do now in my VB application is to dynamically set the database and server name to use with the reports. I have these values as the strings varServer and varDatabase. Anyone know how to go about ...

using older Data Access Application Block alongside newer Enterprise Library

Is there any reason I can't use an older version of Data Access Application Block (sqlhelper) along with Enterprise Library (if I'm not using the data parts of it?) ...

Real-world uses of MySQL savepoints in web services?

Does anyone have experience they can share using MySQL savepoints (directly or via an ORM), especially in a non-trivial web service? Where have you actually used them? Are they reliable enough (assuming you're willing to run a fairly recent version of MySQL) or too bleeding-edge or expensive? Lastly, does anyone have experience with s...