database

Please advise on the exception

Can any body tell me what this exception means, its confusing because I tried all possible ways to change the path of the keystore.. doesn't work. Environment: ORACLE database server, configuring SSL Exception in thread "main" java.sql.SQLException: Io exception: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgo...

Database schema design for schedules

Hi! I have two tables: Companies and Employees. I also have a relation table Employs which contains the foreign keys company_id, employee_id as a composite primary key. Note: employees can work at multiple companies. I would like to have another table EmployeeSchedules which simply contains schedules (company_id:integer,employee_id:in...

How to convert Apache Derby database to MySQL

I would like to convert an existing Derby database to MySQL. ...

Super Slow MySQL - Need Help!

I have a SUPER slow query, which I posted here: http://pastebin.com/E5sdRi7e. When I did an EXPLAIN, I got the following: id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived2> ALL NULL NULL NULL NULL...

Data Structures and their Database Mapping in .Net

Hello. From what I know, complex data structures (tree, binary tree, graph) are not available in the .Net Framework Base Class Library. Is there a good 3rd party library available for this purpose? Further, I need to map these data structures back to a physical database (SQL Server). Is such an extension available? I'd love to have a to...

PHP: SELECT ing 2 tables?

Hello. I have a activities page and a statusmessages page for each user. In activities it contains what the users have done, such as being friends with someone, commented on pictures and so. users_activities id | uID | msg | date In users_statusmessages, I got the statusmessages, the user creates. users_statuses id | uID | messag...

Do I really need to have an ID to a child table in rails using active records ?

I have a user model (sql table) that has_one : profile. profiles have user_id to refer to an user object. Do i really need to have profile_id column ? What are the advantages and disadvantages ? I guess one advantage will be the size of the table that will be 1 collumn smaller. What are the disadvantages ? ...

Solr autoCommit not working

I am using Solr-php-client to communicate with solr via php. I search solr by using this php-client and amongst other information I get from Solr, the total results are returned to a variable in php: $results = $solr->search($querystring, $start_offset, $limit, $solr_params); $num_total = (int) $results->response->numFound; My proble...

Don't know how use 'serialize' method in rails

i have a model called user class User < ActiveRecord::Base serialize :friends end when running the console script and create a new object of User class user = User.new user.friends i found a 'NoMethodError' should i write the serialize calling in another file? OR what should i do to make the friends array an attribute for the ...

Do I need to model a dependency explicitly in an ER diagram?

I was looking at ER diagrams today. If we consider two entities, Item and Member in the context of a rental shop, the member can either checkout an item or renew the item. So for this, I came up with the following: The idea was that a member can check out any number of items but an item can be checked out only once. And, a member can ...

Database Design Foreign Keys

Two tables in my database are as follows: [Employee] Table: Id (Primary Key, Autoincrement) FirstName LastName Status [Status] Table: Status (Primary Key) Status is one of the following: "FullTime" "Contractor" "Terminated" How should [Employee].Status reference [Status].Status as foreign key? I see two ways of doing this: [E...

how to use web service search/get methods

i would like to be able to retrieve results from this search by connecting directly to their database instead of screen-scraping: http://broinc.com/search.php would it be possible to return the results programmatically into some variable, instead of manually doing this search and then going through every page to get the results? ...

EC2 Amazon TCPS question

HI all, I tried posted on amazon forum for which I didn't get a response. TCPS is needed for my oracle database server to be ssl enabled. Looks like there is no options to open the port 2484 or any other for TCPS. Is this true on amazon instances please confirm. Thanks, SR ...

What is the best way to keep changes history to database fields?

For example I have a table which stores details about properties. Which could have owners, value etc. Is there a good design to keep the history of every change to owner and value. I want to do this for many tables. Kind of like an audit of the table. What I thought was keeping a single table with fields table_name, field_name, prev...

How many indexes should be created for faster queries

My object model is given below and would like your inputs on the number of indexes to create for faster query responses (on h2, mysql). Assumptions and questions are given below the following model. @Entity @Table(name = "user") public class User { @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "id", unique = true...

PHP: How to hide the password for database connection/email connection statement?

I have a website developed in PHP. There are 2 classes (in 2 seperate php files) that contain the siteadmin's gmail user id and password (in plain text) and database password (again in plain text). Though none of these classes are displayed on the browser ( like index.php). These files contain only php classes and no html code and the re...

Any way a db change can trigger a method call in Rails?

Is there any way a database change (say an insert statement) can trigger a call to a ruby method in my app? I know about observers but this is sort of a complicated situation, because the database is updated by a Java application. Note, both the Rails and the Java app connect to the same database. ...

Need example how to build SQL database in C#

Need example how to create new local database and a connection string, if possible with a using statement. There should be 1 table and the data that I want to put in there are unique words length 2-50 lowercase characters, and thy can contain "a-zõäöüšž", ordered by ascending. There are 2 actions I want to do with that: Put HashSet o...

Mysql Complex Where Clause

I really surprised when I tried below code in MySQL: SELECT * FROM table WHERE (key='free_shipping' and value='yes') AND (key='price' and value='5') It doesn't work. I need to get product that is both free_shipping is 'yes' AND price equal '5' at the same time. How can I create this query properly? Table Structure: contents: (TABLE...

"disable" some MySql records so they are not returned when searching?

I have a mysql database which I support using phpMyAdmin. The website this is for is a classifieds website. The issue here is that whenever a new classified is posted (and inserted into mysql database), I need to first review it manually. My question is, is there anyway to tell mysql that "this record is inactive, so don't return it"?...