database

Exception in Database

HI I made a method in my class that is: public void addInfo(String username, String password, String name, String family) { try { String sql = "INSERT INTO user VALUES (?, ?, ?, ?)"; PreparedStatement pst = conn.prepareCall(sql); pst.setString(1, username); pst.setString(2, password); ...

How to store multiple items in database. Confused with database structure

I had a select box where the user will select the list of cities they travelled. After that the admin will search for the users with particular cities. I am very confused with the structure of the database. There are totally 300 cities. Creating column for each city and store it with boolean on or off, looks a childish technique. Any o...

text in tables?

Hello, I like to organize a lot of information from literature reviews in "tables" (information not unlike product comparisons, but for scientific research), but often the information I enter can contain lines or paragraphs of text and becomes unwieldy in a spreadsheet. I've heard SQL relational tables are often used for this purpose; fo...

looking for a db abstraction/substitute that actually works

i am looking for a form of data storage that will answer a few requirements. i realize these requirements are non-standard, and for now i'm using activerecord and ORM solutions like everyone else, but this is my "holy grail" - if you know of anything like this, i would be eternally grateful: pure PHP multiple repositories, preferably f...

Validate FK now or recover from later?

What's the more accepted Rails approach? Validate that a foreign key exists on creation/update or "Damage control" when we want to use the non-existent foreign key? Initial validation requires more resources on row creation/updating, and may even be redundant when I'm creating rows systematically in my code (i.e. not user generated)....

What are the tradeoffs of reusing a cursor vs. creating a new cursor?

In cx_Oracle (or Oracle in general), is it possible to allocate a cursor for each query, or to reuse a cursor across several queries. def getSomeData(curs): # case 1: pass in a cursor, which is generally curs.execute('select ...') # reused across queries return curs.fetchall() def getSomeData(conn): # ca...

Handling many-to-many inserts with Ibatis

I'm new to Ibatis and have a question regarding the mapping of many-to-many relationships. In my application's data model I have a many-to-many relationship between two of the entities, with the tables in the database looking like this: CREATE TABLE A ( id int PRIMARY KEY ) CREATE TABLE B ( id int PRIMARY KEY ) CREATE TABLE A...

How to combine data from 2 tables under circumstances?

I have 2 tables. One table contains posts and the other contains votes for the posts. Each member can vote (+ or -) for each post. (Structure example:) Posts table: pid, belongs, userp, text. Votes table: vid, userv, postid, vote. Also one table which contains the info for the users. What I want is: Supposing I am a logged-in membe...

Limit a sqlite Table's Maximum Number of Rows

I am looking to implement a sort of 'activity log' table where actions a user does are stored in a sqlite table and then presented to the user so that they can see the latest activity they have done. However, naturally, I don't feel it is necessary to keep every single bit of history, so I am wondering if there is a way to configure the ...

Is it highly necessary to record the registration date of new website users?

What are the advantages and disadvantages? ...

How to back up the embedded H2 database engine while it is running?

I would like to build up an web application with H2 database engine. However, I still don't know how to back up the data while the database is running after reading this tutorial: http://www.h2database.com/html/tutorial.html#upgrade_backup_restore Does H2 output its stored file to somewhere in the file system? Can I just back up the ou...

Visual studio asp.net sql Server insert form

I have to do this thing for work that's really just a formality. Normally I'm a linux/UNIX guy but they're making me do this. I need to have an asp webpage that displays data from two different database servers. This is easy -- just a drag and drop in visual studio. The problem is I also need a way to insert a new row into a table on the...

mySQL DB: Making simultaneous entries?

Consider the following tables for a LMS: Item ( ID BIGINT NOT NULL UNIQUE AUTO_INCREMENT, ConnectLog BIGINT NOT NULL, ItemClass BIGINT NOT NULL, ItemType BIGINT NOT NULL, AcqDate TIMESTAMP NOT NULL DEFAULT NOW(), Vendor BIGINT NOT NULL, Cost DECIMAL(64,2) NOT NULL DEFAULT '0....

wordpress plugin, access $wpdb on non visible page

I'm creating a wordpress plugin to fetch data from another website, It will be a cron file and I need to store some data in a table. how do I access $wpdb from that file? do I need to link to a wordpress core file? I'm asking this because it's not a file that will be visible in the admin area or public area, it's just a file that run's ...

Oracle - Need help with RMAN Active Duplication on Windows 32 bit to a 64 bit

I need to have an Oracle 11g R1 on a Windows 32-bit duplicated to a Windows 64-bit using RMAN Active Duplication. 32-bit setup: Windows Server 2003 R2 Standard Ed. SP2 Database - Oracle 11g 11.1.0.6.0 64-bit setup: Windows Server 2008 R2 Standard Ed. Startup Database - Oracle 11g 11.1.0.7.0 Although 11g R1 is not cert...

Yet another dynamic data model question...

I have a project that requires user-defined attributes for a particular object at runtime (Lets say a person object in this example). The project will have many different users (1000 +), each defining their own unique attributes for their own sets of 'Person' objects. (Eg - user #1 will have a set of defined attributes, which will ...

MySQL Row-level Revision Control

I’m creating revision control for data in our database. It will have the ability to store revisions, rollback, and rollback rollbacks. The database tables I’m using that needs to be revisioned is below: objects object_chunks object_attributes Objects is the main object, chunks are grouped up sections of the object, and attributes are a...

An API which allows users to connect directly to the database

I've worked with many APIs and it's never usually an easy task. Messing about with POST requests and then trying to handle the XML is a pain. And I thought wouldn't it be easier for both user and developer if they could just directly interact with the database. Is it possible to create a user which API users would connect to then assign...

How to represent relationship between two items in DB?

Hello, me and my colleagues are developing a website with similar idea as Stackoverflow, but for submitting tasks (and for internal use). This morning we talked about tagging tasks and couldn't really figure which option would be the fastest one, or if we aren't missing something. Let's imagine table with tags, which would dynamically ...

Setting authentication for berkeley-db

How to set the user authentication for my db application in Oracle Berkeley db java edition? ...