database

Bring current user to the database layer

I have a classic 3-tier web application build with MySQL and Tomcat. I want to save the creator id of each database record for all tables at creator_id column or just log it somewhere. Current user is stored at the http session object. Modify all queries and pass creator id parameter is unacceptable. Can I solve the problem using trigg...

Return DataReader from DataLayer in Using statement

We have a lot of data layer code that follows this very general pattern: public DataTable GetSomeData(string filter) { string sql = "SELECT * FROM [SomeTable] WHERE SomeColumn= @Filter"; DataTable result = new DataTable(); using (SqlConnection cn = new SqlConnection(GetConnectionString())) using (SqlCommand cmd = new Sq...

What is the best language and best tools for developing a desktop application with a database?

I mean by that, for a small app, what would be the best database, best IDE, best language, best tools and easy to deploy? Thanks, everybody! ...

Storing time-temperature data in DB

I'm storing time-temperature data in a database, which is really just CSV data. The first column is time in seconds, starting at zero, with the following (one or more) column(s) being temperature: 0,197.5,202.4 1,196.0,201.5 2,194.0,206.5 3,192.0,208.1 ....etc Each plot represents about 2000 seconds. Currently I'm compressing the ...

Mysql connectivity from POcket pc application using .netcf 2.0

Hi, We are developing an order taking system in PDA using C# in .netcf 2.0. So we are having mysql server as our back end. Is that the web service is the only way to connect mysql with PDA? Or is any other methods available..? ...

How do I generate SWX data files serverside?

By storing data in SWX files on the server, it can be interpreted automatically like loading one SWF into another. Now I'd like this data to be modified by server side code, how can I do this? Are there any SWX libraries for PHP that I can use? ...

How to implement high performance tree view in SQL Server 2005

What is the best way to build the table that will represent the tree? I want to implement a select ,insert ,update and delete that will work well with big data. The select for example will have to support "Expand ALL" - getting all the children (and there children) for a given node. ...

How do i update mysql database with ajax and php in innerhtml

How do i update mysql database with ajax and php with no page refresh ...

Databases using JSON as storage/transport format

How many database systems there are that use JSON for storage or transport? I know of: CouchDB MongoDB DBSlayer I remember I saw yet another vendor in a SO user's profile. That systems was using what they called binary JSON, but I can't remember the name of the product. Lately, it appears that more and more DB projects are looking t...

How to find a first column and first row in a table using SQL

I was asked this question and could not come up with the answer. Is there a way to find the entry at the first row and first column in a table? (In matrix notation, that would be the [1,1]th location) ...

Auto generate key on JDBC insert in SQL Server

Is there a general, cross RDMS, way I can have a key auto generated on a JDBC insert? For example if I have a table with a primary key, id, and an int value: create table test ( id int not null, myNum int null ) and do an insert PreparedStatement statement = connection.prepareStatement("insert into test(myNum) values(?)", Statem...

What do you think of returning select object instead of statement result ?

I would have liked to know if it was a good idea to return a select object from a method like '$selectObj = getSomethingByName($name)' to then pass it to another method like 'getResult($selectObj)' which will do the trick. The idea is to be able to pass the select object to any usefull function like 'setLimit(10)' or addCriteria('blabla'...

Lost update problem in Concurrency control

I have two transactions T and U which are executed simultaneously in a DB. How does one provide an example of the lost update problem? We can assume that we have three accounts A,B,C and they each have £100,£200 and £300 respectively. ...

sql userid + name + profile optimize question

Chances are i will need to do a lot of userid->username lookups. So i was thinking, instead of having a table like the below userid int PK username text userpass_salthash int user_someopt1 int user_sig text to have it broken up as the below //table1 userid int PK username text //table2 userid int //fk userpass_salthash int user_some...

From Netbeans Dev to Tomcat Production: DB Connection Not Found

I developed a Java web application in Netbeans 6.5 using a MySQL database and Hibernate. Both the development database server and development application server (Tomcat 6) reside on my development machine. Everything works; the application pulls data from the database correctly. Now, I'm ready to move it to the production server. Aga...

Generic DB Table

Is there any name for the following DB table design: Basically we have generic columns representing key/value pair. id | k1 | v1 | k2 | v2 | k3 | v3 | .... 1 | name | sam | last_name| smith | NULL | NULL | ... In my application, I have many tables that have only one row and I would like to merge them into a generic ...

Is a primary key required in this particular scenario?

I have a name table with (id,first_name,middle_name,last_name,sex) and an email table with (id_fk,email_add) Infact I will be having similar tables of the second kind, like a phone table (id_fk,phone_no), where id_fk is the foreign key referring to the id in the name table. Is it required or rather is there a good reason to have a prim...

Efficiency of transaction in code vs. DB

What is more efficient -- having a IDbTransaction in the .net code or handling it in the database? Why? What are the possible scenarios in which either should be used? ...

How do I make multiple database queries more efficient in Perl?

Hi all, I have a queries that reside in multiple methods each (query) of which can contain multiple paramaters. I am trying to reduce file size and linecount to make it more maintainable. Below is such an occurence: $sql_update = qq { UPDATE database.table SET column = 'UPDATE!' WHERE id = ? ...

Asynchronous procedure call with DB2 .NET Data Provider

Is there any way to asychronously call a DB2 stored procedure using DB2 .NET Data Provider? ...