database

How to use reverse engineering in my eclipse

i am using MySql workbench and My Eclipse 8.6. and making a Hibernate-spring program. Is it possible to use reverse engineering feature in my eclipse with MySql workbench in so that DAO and hbm files can be generate like Derby. How can i do this with MySql workbench. this is a URL of using reverse engineering in my eclipse. http://www.my...

can I have one db for multiple wordpress sites but multiple wp codes/installations

I need few Wordpress sites for testing purposes. It would be great if I can use only one db but I need few wordpress codes/instalations (because I need different settings and plugins for each site. Can I have all that running on one mySQL db? Would use the same db_name, db_user, db_password, etc… and the only thing I change for the...

Multiple database support

Hi, Did you get any way to have different database session for different user session?? If yes please tell me how to do that. Thanks Nitin ...

How can I compute a conditional sum in my model?

Say I want something like this in Rails: class Proposal < ActiveRecord::Base def interest_level self.yes_votes.count - self.no_votes.count end private def yes_votes self.votes.where(:vote => true) end def no_votes self.votes.where(:vote => false) end end What have I basically done w...

How would you test this code? (phpUnit)

How would you test the following code with phpUnit? class Product { protected $id = null; public function __construct($id) { $this->id = $id; } public function getDescription($language_id) { $db_query = mysql_query("SELECT * FROM products_description WHERE products_id = " . (int) $this->id . " AND lang...

Running NHibernate queries without joining

I have Fluent mappings that maps a fictional class Customer to a list of Orders. Now I want to fetch all Customers from the database without loading Orders. Can this be specified somehow in the query/criterion/etc, or is LazyLoading the only solution? Fictional classes: public class Customer { public virtual int Id { get; set; } ...

SQL: Need help creating a one-to-many Set comparing query

The parameters are thus: I have a table called Tasks with columns ID (primary key) and label (text). I have another table called Locations with a foreign key referencing Tasks' ID and a name for a location (text). In my code I have a set of locations. UPDATED: I need a query to return all tasks that have associated locations found with...

PL/SQL cannot add more than 2 arguments in add operator?

I have this procedure: PROCEDURE P_SUMMARIZE_ACTIVATED ( pStartDate IN DATE, pEndDate IN DATE, SummaryCur OUT MEGAGREEN_CUR ) IS BEGIN OPEN SummaryCur FOR SELECT USER_ID, sum(case SERVICETYPE_ID WHEN 1 THEN 1 ELSE 0 END) AS Package1, SUM(CASE SERVICETYPE_ID WHEN 2 THEN 1 ELSE 0 END) AS Pack...

How to give 3 relations to same table in Cakephp

Hi i am new in cake php and can't solve the problem. The problem is I have a table like; id varchar(16) parent_id varchar(16) text text user_id bigint(20) is_deleted_by_user bit(1) is_deleted_by_us bit(1) who_deleted bigint(20) who_answ...

Concurrent Database transactions

My requirement is to fetch a unique ID from the database for processing on the application server(clustered application).For this , I have a table with single cell, holding a value X. This value will be incremented everytime it is fetched. BEGIN TRAN UPDATE ID_TABLE SET VALUE = VALUE + 1 SELECT VALUE FROM ID_TABLE END TRAN ...

I am not able to Disable CheckBox in GridView

I am not able to Disable CheckBox in GridView , whats the problem with my code ? can somebody please take a look at my code and suggest something. foreach (GridViewRow row in GridView1.Rows) { CheckBox ch = (CheckBox)row.FindControl("CheckBox1"); if (ch.Checked) { String ExamineeId ...

Problems When Querying Oracle Database For List Of Tables: "table or view does not exist"

Hi, In my program I need to access the schema of an Oracle 11g database. I have been trying to get a list of tables using a query like this: SELECT t.TABLE_NAME, t.OWNER FROM ALL_TABLES t WHERE t.DROPPED = 'NO' ORDER BY t.TABLE_NAME The query works and I get back a list of tables. Unfortunately when querying some of the tables using ...

Simple database migration error in Rails

Hi, I am not able to create database columns when i use t.string or t.number. When i did rake db:migrate i got this C:\Ruby\joker\chapter3>rake db:migrate (in C:/Ruby/joker/chapter3) == CreateComicBooks: migrating =============================================== -- create_table(:comic_books) -> 0.0630s == CreateComicBooks: migrate...

Django: form that updates X amount of models

Hello, I have a page where it displays a filtered model instance list and allows users to update some fields of it or add new fields as a form. I am curious what wpuld be a clever way of doing this, to delete and resave all the input data or make comparison for each data and save edited / new fields& entities. I would like to mind you ...

Does this function release resources properly?

I'm trying to make sure that I don't leave any loose ends open in my application and am concerned about a few but might get my answer from this one. I've "overriden" some functions so that way I can try and keep all the resources as clean and free as possible. So in this instance, I have a function called ExecuteReader which returns a ...

MySQL query for sorting by multiple date values

I'm creating a PHP script that fetches IDs from a database. The results are sorted by two datetime values, createdon and publishon. The priority of publishon is higher than createdon; however, publishon may also be NULL. publishon = null => sort by createdon. Can someone help me sort those rows? ...

using MySQL with C#

I want to know if it is possible to use MySQL Engine without having to install WAMP Server. I'm developing an application that will require a database, so I was thinking of using MySQL instead of MS SQL or access. So I don't want to install the WAMP package yet I want to install the MySQL Engine, so if possible, please provide me with th...

Database that can handle >500 millions rows

I am looking for a database that could handle (create an index on a column in a reasonable time and provide results for select queries in less than 3 sec) more than 500 millions rows. Would Postgresql or Msql on low end machine (Core 2 CPU 6600, 4GB, 64 bit system, Windows VISTA) handle such a large number of rows? Update: Asking this q...

Partitioning the Users - multiple OpenIDs

There is database of users. Let's say that I want to support that some users can have multiple OpenID's and use them to log in and let's say that I want to partition Users in to the multiple databases. Is there some solution for this ? StackOverflow supports two OpenIDs per user, how would they do this? If the users could use only one ...

Run a single Maven plugin execution?

I thought I was an experienced Maven user, but I am having a mental block on how to do this! I've been able to use the Maven sql plugin to drop, create, and install a schema in a database via plugin executions I've defined and bound to the pre-integration-test phase. However, now I'd like to use that same sql plugin to insert some samp...