database

How to get prepared SQL statement from JdbcDaoSupport (Spring)

I use JdbcDaoSupport (Spring) approch to access data from my DB. I would like to get prepared SQL statement for logging. Any idea how to get it? ...

C# WinForms - how to send updates from DataGridView to DataBase

Hey, I have a .mdb file with a Customers table and an Agents table. The only thing that the Agents table does as yet is populate the Agent dropdown for each customer... I have a DataGridView linked to the customerBindingSource. The customerBindingSource has DataMember set to Customer and DataSource set to bindingSource1. This has the D...

Retrieving database data - General retrieve method?

Hello, My data access classes often have a method called loadDataToEntity or something similar. This method takes a resultset for instance and populates an entity class which is passed on to be used by the client. This is nice because all methods which use a stored procedure to retrieve data can just pass the resultset to the loadDataT...

Can you recommend me a way to create a sample portion of a data-base as an xml file to be consumed by Unit Tests?

Hi, Can you recommend me a way or tell me the most common practice to create a sample portion of a data-base as an xml file so that I can use it from my unit tests without worrying about Db state to be persistent? Is there any frame work to overcome such a scenerio including the functionality that after each test I can get back to the ...

HTML5 Database API : Synchronous request

Hi, i currently use the client side database on an html5 iphone webapp. In my code i need to check if a row is present in the local DB : function isStarted(oDB) { var ret = null; oDB.query(sql,params,function(transaction,result) { if(result.rows.length > 0 ) { ret = true; } else { ret = false; } }); ret...

Simple query optimization

Hey guys, forgive me if this is too simple a question. I basically want a count of the number of males and females in a database. So I know two simple queries will accomplish this, such as: select count(*) from table where gender='male' select count(*) from table where gender='female' However, this seems very inefficient since I know ...

Query Form Logic: "Like" vs. "Equals"

Our application provides multiple query interfaces that are basically just text inputs. Is there a best practice on whether the backend logic should be pad the query parameter with wildcards then perform a like or should it just do an equals. Of course another option would be to allow user's to use wildcards and then check and use a "l...

C# - updating database file in C:/ or C:/folder causes fatal readonly file error

Hey, I have a database file in my C:/ directory (which I have also tried putting in the C:/CustomerApp_C directory). I can run the application and it loads the data just fine. However when I change some data and click Save it comes up with "Unhandled exception has occurred in your application. bla bla bla"... "Failed to update database ...

How to store data from MATLAB to Access DB?

I want to store my results from neural network in MATLAB to Access database, and also store video with it to the same database. For other time when everyone result the same pic from neural network the output for him is video that was stored before in DB... Can you help me? ...

Java application code structure

My Java application is not very big, but I would like to do it the "right way". Looking for suggestions to not make a big mess... I am using Swing, the Swing Application Framework and H2 database. It is a single frame application with different tabs. Most tabs will reflect some aspects of the data in the database. Some of them will be ...

Customize WordPress comment post query

Hello! I am trying to extend the functionality of the comments in a WordPress install. I read allusion to an elusive 'custom comment type' functionality, but could not find any information. Instead, I was thinking that I would add a custom column ' to the 'comments' database table. That's the easy part. What I have no clue how to do is t...

Compatible boolean data type of various relational databases

I am trying to create a select statement that is compatible with all major relational databases (MySQL, PostgreSQL, Derby, SQLite, ...). Here the simple select statement: SELECT * FROM taggings WHERE public IS TRUE The problem is that SQLite for example does not support the boolean data type, so I rewrote my statement to: SELECT * FROM...

Is there an Erwin Macro to pull out the table comment/definition?

I created a script template to generate the extendend properties to basically to include the data dictionary in the database, however, i couldn't find any macro to read-out the table comment from the model. Is there any hack for this? ...

Which .NET data storage technology: Data access local only and web service based

I'm just starting with .NET data storage and I'm confused by so many different technologies... This is a learning project. You don't need to go on reading, I need to make an architecture proposal first... Thanks so far My scenario: e.g. a local app that can store and tag images. The user can choose if he want to store his data loca...

Pick another RDBMS

Other then Oracle, MySQL, and PostgreSQL, what is out there? Is there anything else used in a production environment? By production I mean it's used to support an active project or application and not an unstable system. I'm curious about other database systems (aside from NoSQL) that are applicable for use. Looking at the feature set ...

When I do Geospatial querying in MongoDB, how do I also return the distance from my desired point?

for post in db.datasets.find({"loc":{"$near":[50,50]}}).limit(10): How do I get the distance between the document and "50,50"? ...

IBM Nested Relational Database White Paper

I'm reading up on recent advances in databases and came across many references to a White paper by IBM entitled "Nested Relational Database". However the links seem to be broken, and I have not been able to find a copy on IBM's website. Does anyone know where I can find a copy of this paper? ...

How do you query this in Mongo? (is not null)

db.mycollection.find(HAS IMAGE URL) ...

Copy data from one existing row to another

I have one table for storing status and comment.Some more columns are there.Now each time one new comment is posted I need to insert one new row in that table(change is only in the comment field , status and all other column values will remain as it is).What's the best way of doing this? ...

Why to add clustered index keys to all (intermediate) nodes on NCI?

Considering clustered table, Quassnoi wrote (the last phrase in answer): If the secondary index is declared UNIQUE, clustered key is appended only to the leaf-level records of the secondary index. This sounds like clustered key is added to (all) indermediate nodes of non-unique non-clustered index. And by the same logic RIDs are a...