mysql

How do I setup my MySQL with Eclipse IDE?

I am using Eclipse EE IDE and I am using the MySql Connector/J driver. How do I set up a properties file with all the information(DB URL, DBusername,etc) Also I see that you need a DBname and DBurl for the properties file, How do I determine/create this name for the database. I have already looked at the mysql website for this and am sti...

Efficient way to communicate between Flash and MySql?

What is the best/fast/efficient way of communicate between Flash and MySql? I have a multi-players online game using Flash-php-MySql, it seems like when I reach 5 or more players, the game is laggy. And I believe that problem is because of request and response from MySql through php. I am using URLRequest, Post method in AS3 file. I tri...

Searching in a database with over 3 mil. entries

Hello, I'm using Geonames database for a hotel booking website. The database has two tables, one for countries, and one for cities with over 3 mil. entries. If I try to get all the cities for a specific country the query is too slow. I think is because I don't have any index defined. The countries table has the following fields: iso...

How to insert,delete,select,update values in datagridview in C# using MYSQL

Hi all, Below is the code to insert value into mysql database, using datagridview. But the selectcommand is working.It is not happening since i get error stating "Column 'username' cannot be null ". This error does not pop up if i use ms access database. Can anyone help me on this. is there any other method to do so. private void b...

Retrieve an image and load it in a html page

Hi friends, I am working with php and ajax. I'm able to retrive an image from a database, but I would like to show the image in 100px x 100px size, but it just retrieves the original image size and spoiling the aligning work that I did. How can I fix the width and height for a retrieved image. I have used the following code for retrivin...

Multi-threaded access to MySQL using ADO.Net

I'm developing an ASP.Net web application which makes use of MySQL via the MySQL-Provided Connector/NET, which is an ADO.Net-compatible interface. My understanding of ASP.Net is that concurrent requests will be processed in separate threads, so my code will need to be thread-safe. I can't find anything in the MySQL documentation that ex...

I need to make new database in mysql with Java

How can I dump database schema to MySQL database with Java JDBC conncetor? I have my database schema in text file. ...

Should I store emails in a DB or in a text file ?

Hi, I need to store email address from a simple form (like a newsletter), but the website loading is high, I'm then wondering if I'd rather store them to a text file (eventually write a cronjob to store them each night to the DB), or store them directly to the DB ? ...

MySQL Prepared Statements vs Stored Procedures Performance

Hi there, I have an old MySQL 4.1 database with a table that has a few millions rows and an old Java application that connects to this database and returns several thousand rows from this this table on a frequent basis via a simple SQL query (i.e. SELECT * FROM people WHERE first_name = 'Bob'. I think the Java application uses client si...

can't see bit(1) fields in mysql

I have a Java application and have mapped a boolean field to a bit(1) field in MySql. I know for sure that some rows have the value set to true and some to false, however, I can't see it from the mysql console - which is annoying when you try to debug things and understand what is going on. Is it possible to configure mysql to display ...

Can we create tables dynamically in MySQL?

Can we create tables dynamically in MySQL? If so, how? Dynamic means at run time....ie via procedure AND HOW???? I am using dotnet Ans--> yes we can create...but problem is i want to change the name of table each time the procedure is called.... ...

PDO looping throug and printing fetchAll

I'm having trouble getting my data from fetchAll to print selectively. In normal mysql I do it this way: $rs = mysql_query($sql); while ($row = mysql_fetch_array($rs)){ $id = $row['id']; $n = $row['n']; $k = $row['k']; } In PDO, I'm having trouble. I bound the params, then I'm saving the fetched data into $rs like above, wi...

Selecting pages by path in MySQL/SQLite databases

Hi all, I am storing pages for websites in a 'pages' database table, they are referenced by their path (i.e. 'articles/my-first-blog-post'), I need to select all the children of a particular page, but without selecting grandchildren. So if I run: SELECT * FROM pages WHERE path LIKE 'articles%' I'll get pages with the following paths:...

how to database connectivity between mysql and eclipse java

how to database connectivity between mysql and eclipse java? plz tell me hw it can be done? ...

How to seek foreing key violations on whole database? (I'm currently using MySQL)

Sometimes we load data from a lot of sources, like files, streams, etc. Well ... to do it with low headaches, we usually disable foreign keys checking, the problem is that when we do get some foreign key constraint violations that we are not warned of that. How can we check this after restoring foreign key constraints? ...

Incompatibily between ruby and mysql gem

When trying to install the mysql gem from cPanel on my website, I get an error saying that the gem requires Ruby >= 1.8.6. This is a shared server and the version of Ruby is 1.8.5 and can't be upgraded. I do not have shell access and it seems the only way for me to install a gem is through the list of gems within cPanel. How can I get m...

What is a efficient way to delete the most recent X record from SQL?

I have a simple table where one of the field is a date column. I can select the most recent X records by doing Select * from MyTable order by last_update desc limit X But how do I efficiently delete those column? Is subselect the quickest? ...

Database design: Keeping track of tag changes between revisions

I'm building a revision system similar to the one Stack Overflow has and there's one thing I can't get my head around, what's the best way to the differences in tags between multiple revisions? The simplest way I can think of is we have 3 tables, revisions, tags and another to link the two. Each revision then has its own set of tags, t...

Multi-table Update(MySQL)

Hey all, I have a question regarding multi-table update(MySQL). Consider table t1 and t2. The PKEY for t1 is 'tid' which is a foreign Key in t2. There is a field "qtyt2" in t2 which depends on a field called "qtyt1" in table t1. Consider the foll SQL statement: UPDATE t2,t1 SET t2.qtyt2=IF(( t2.qtyt2- t1.qtyt1 )<0,0,( t2.qtyt2- ...

RENAME faster than DROP+ADD in MySQL alter table

I'm performing some MySQL table maintenance that will mean removing some redundant columns and adding some new ones. Some of the columns to drop are of the same type as ones to add. Would the procedure be faster if I took advantage of this and reused some of the existing columns? My rationale is that changing column names should be a s...