Suppose we have a table with rows representing nodes of a tree structure, each node being represented by an id, a parent id and a position between the children of its parent node: CREATE TABLE `tree`.`node` ( `idnode` TINYINT NOT NULL AUTO_INCREMENT , `idnode_parent` TINYINT NULL , `position` TINYINT NULL , PRIMARY KEY ( `idnode` [...]
I tried moving all my databases from MySQL 4.1 to MySQL 5.1 on Windows and since I had some InnoDB tables I could not just copy the data files between MySQL Server versions (from C:\Documents and Settings\All Users\Application Data\MySQL\MySQL 4.1\data\ to C:\Documents and Settings\All Users\Application Data\MySQL\MySQL 5.1\data\). So, after I exported the data from the [...]
This error occurs on any operating system (windows, linux). The problem is that instead of getting a sql file with the database data you get a empty (0 kb.) file. So we have the following code: $command = “mysqldump –opt –skip-extended-insert –complete-insert -h “.$DB_HOST.” -u “.$DB_USER.” -p “.$DB_PASS.” “.$DB_NAME.” > backup.sql”; exec($command, $ret_arr, $ret_code); echo [...]
Full error message: #1005 – Can’t create table ‘.\my_db\#sql-7c4_444.frm’. Using MySQL version 4.1.22-community-nt, I created two tables (`table1` and `table2`) in a database (let’s call it `my_db`) as follows: CREATE TABLE `table1` ( `idtable1` int(10) unsigned NOT NULL auto_increment, `table1_str` varchar(50) NOT NULL default ”, PRIMARY KEY (`idtable1`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `table2` [...]
Problem: Using specific characters from European languages like Romanian, Bulgarian, Czech and so on (usually the ones without support in ISO 8859-1) rises errors when displaying the content in browsers turning special characters in unrecognizable ones. My fix for this problem is using UTF-8 character set encoding for every page of the website and the [...]
Full error message: Exception occurred during event dispatching: org.hibernate.HibernateException: identifier of an instance of members.Appointment was altered from 8 to 8 at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:58) at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:157) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:113) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at members.AppointmentDialog.jButtonSaveActionPerformed(AppointmentDialog.java:279) at members.AppointmentDialog.access$000(AppointmentDialog.java:21) at members.AppointmentDialog$1.actionPerformed(AppointmentDialog.java:101) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) [...]
Full error message: Exception in thread “main” org.hibernate.exception.GenericJDBCException: could not execute query at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.loader.Loader.doList(Loader.java:2223) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at admin.MembersTableModel.<init>(MembersTableModel.java:43) at admin.AdminOptionsForm.initComponents(AdminOptionsForm.java:98) at admin.AdminOptionsForm.<init>(AdminOptionsForm.java:32) at managemembers.Main.main(Main.java:45) Caused by: java.sql.SQLException: Cannot convert value ’0000-00-00 00:00:00′ from column 9 to TIMESTAMP. [...]
