database

Auto generate data schema from JPA annotated entity classes

I'm using JPA (Hibernate's implementation) to annotate entity classes to persist to a relational database (MySQL or SQL Server). Is there an easy way to auto generate the database schema (table creation scripts) from the annotated classes? I'm still in the prototyping phase and anticipate frequent schema changes. I would like to be able...

How do I sync the results of a Web service with a DB?

I am looking for a way to quickly compare the state of a database table with the results of a Web service call. I need to make sure that all records returned by the Web service call exist in the database, and any records in the database that are no longer in the Web service response are removed from the table. I have to problems to sol...

Changing the database at runtime in Grails application

I am wondering if there is a way to change the database at runtime in grails - e.g., in most commercial/opensource CMS, they allow the database server to be hosted elsewhere, and you can specify the address in some config screen at runtime. since grails configs the database server using DataSource.groovy, how does one access the intern...

How do I relate one table to many different tables?

I have a list of tables i.e. student, teacher, staff, dept. and so on and each of these tables have comments specific to them. Now one record in a table can have one or many comments that shows it's a one to many relation from any table to comments table. I don't know what the best way is to relate comments table to each of these. If I p...

Getting XML Schema from MS SQL Database

Is it possible to generate a XML Schema of a Database programatically with .Net and C#? I want to look into NDbUnit but for big databases it would not really be feasible to make a Schema manually? EDIT: Question wasn't clear. ...

What is the difference between a schema and a table and a database?

This is probably a n00blike (or worse) question. But I've always viewed a schema as a table definition in a database. This is wrong or not entirely correct. I don't remember much from my database courses. ...

NHibernate IInterceptor implementation(add properties to DB table that original domain class doesn't have)

How is possible to set some special column values when update/insert entities via NHibernate without extending domain classes with special properties? for example: in my case i would like to get object and just moment before update/insert db add to that object some additional information (like user id or computer name) by using IInterce...

Is it acceptable to cross between databases?

I'm not sure what this practice is actually called, so perhaps someone can edit the title to more accurately reflect my question. Let's say we have a site that stores objects of different types. Each type of object has its own database (a database of books and assorted information with its tables, a database of CDs and information with ...

Comparison: DB Full Text search to Search engine (Lucene)

With stackoveflow.com in perspective (team of 2-3 engineers building a website project intended to scale) does it make sense to spend effort early in the process of development to build a search based on Lucene/Autonomy… as opposed to a database based full text search. Pros/Cons: With a mature Lucene implementation like nutch or auton...

How should I temporarily store rows in a stored procedure?

In essence I'd like to store some rows in a temporary variable for the life of a procedure in MySQL. My procedure will grab a column of foreign keys at the beginning of the procedure. Once I'm done working with them I want to update the table to indicate that they have been processed. There may be inserts into this table while my proced...

What is database /DBMS "patch access"?

Could not find this term very easily on google. I assume it's the ability to patch a DBMS with an update without stopping service. Is this correct? If not, please guide me. Thanks in advance. jbu ...

Can I do transactions and locks in CouchDB?

I need to do transactions (begin, commit or rollback), locks (select for update). How can I do it in a document model db? Edit: The case is this: I want to run an auctions site. And I think how to direct purchase as well. In a direct purchase I have to decrement the quantity field in the item record, but only if the quantity is great...

Jumpdrive-Portable Database with GUI frontend

Is there a simple database program to let me collect, sort, tag, and reguritate trivia questions and answers? If something already exists in Open Source, can you point me to that? I have assembly programming skills (cue jokes) but not so much in the Perl,LINQ,Delphi,VB, C#, Java arena. ...

many-to-many lookup

I am making a waitlist application. I'd like to be able to send applications a unique confirmation code - and later on be able to find a user either by confirmation code or by username. Will Symfony be able to call Models to say either: Code->findUser($code_string); User->getCode(); I believe that the below schema has the relationshi...

How can I use a database server from a Perl CGI script?

My program works already, I have Perl (GUI Window) where I can input data, data passed to the webpage (using to Tomcat server, JSP) and then saved it to oracle database. What I want is to make search parameter (webapp) that retrieve/extract data from the Oracle database using Perl CGI. Is it possible? Or any suggestions to solve my progr...

How to update turbogears application production database.

Hi, I am having a postgres production database in production (which contains a lot of Data). now I need to modify the model of the tg-app to add couple of new tables to the database. How do i do this? I am using sqlAlchemy. ...

Scaling databases with cheap SSD hard drives

Hey guys! I hope that many of you are working with high traffic database-driven websites, and chances are that your main scalability issues are in the database. I noticed a couple of things lately: Most large databases require a team of DBAs in order to scale. They constantly struggle with limitations of hard drives and end up with ve...

How to create a form to edit a one to many relationship?

Using MS Access 2007, I am creating a student management database. I have tables for: Students Courses CourseSection What I needed is a way to assign students to a course section. So I created a table that links students and sessions: StudentsInSection (contains foreign key to students and foreign key to course section) I would ...

Which is the Best database for Rails application?

My doubt is the following: I will start to developing a Rails application that will accesss a lot of RSS feeds or crawl sites for data (most news). It will be something like Google News but with a different approach, so I'll store a lot of news (or news summaries), classify them in different categories and use ranking and recommending t...

Rails: How do I check if a column has a value?

How can I accomplish this? <% for agent in @broker.agents %> ... <% if agent.cell %><span class="cell-number">Cell: <%= agent.cell %></span><% end %> ... <% end %> I want to test to see if the agent has a cell number, and if so, display what's inside the conditional. What I have currently doesn't seem to work; it just displays ...