Board index » jbuilder » default values problem with mysql version 5
|
Anton Jungreuthmayer
JBuilder Developer |
|
Anton Jungreuthmayer
JBuilder Developer |
default values problem with mysql version 52007-08-17 11:16:34 PM jbuilder4 I have an application written in java with jBuilder. This uses JDBC to access a mySQL database which I am converting from version 4.1 to version 5.0 When my application tries to INSERT a record but does not specify a value for a text field that is defined as NOT NULL with no default set the following error message is returned : Field 'somedata' doesn't have a default value this doesn't happen with JDBC on mysql 4.1 It also doesn't happen when I run the command in mysql, or when using mySql query browser but only when I connect using JDBC Any clues ? Anton |
| Paul Nichols [TeamB]
Java Developer |
2007-08-17 11:46:01 PM
Re:default values problem with mysql version 5
Anton Jungreuthmayer wrote:
QuoteI have an application written in java with jBuilder. which JDK version? This is not going to be related to JB, unless you are using the QueryDataSet, which may or may not work correctly with newer JDBC implementations. |
| Anton Jungreuthmayer
Java Developer |
2007-08-17 11:51:07 PM
Re:default values problem with mysql version 5
Paul Nichols [TeamB] wrote:
QuoteAnton Jungreuthmayer wrote: {smallsort} |
| Paul Nichols [TeamB]
Java Developer |
2007-08-19 02:45:09 PM
Re:default values problem with mysql version 5
Anton Jungreuthmayer wrote:
QuotePaul Nichols [TeamB] wrote: been reported. To get around this issue try setting jdbcCompliantTruncation=false. This will prevent the exception from being thrown before it gets to the MySQL Server. See example below: Class.forName("com.mysql.jdbc.Driver"); String dburl = "jdbc:mysql://server/TEST"; String dburlTrunc = "jdbc:mysql://server/TEST?jdbcCompliantTruncation=false"; String dbuser = "TEST"; String dbpass = "TEST"; Connection connection = DriverManager.getConnection(dburl, dbuser, dbpass); |
| Anton Jungreuthmayer
Java Developer |
2007-08-19 05:02:29 PM
Re:default values problem with mysql version 5
Paul Nichols [TeamB] wrote:
QuoteAnton Jungreuthmayer wrote: |
| Paul Nichols [TeamB]
Java Developer |
2007-08-20 10:29:40 AM
Re:default values problem with mysql version 5
Anton Jungreuthmayer wrote:
QuotePaul Nichols [TeamB] wrote: not with Java JDK or JBuilder. |
