Class SDriverMySQL

java.lang.Object
simpleorm.sessionjdbc.SDriver
simpleorm.drivers.SDriverMySQL

public class SDriverMySQL extends SDriver
This contains MySQL specific code.

CHAR/VARCHAR max size 255(!) Thence TEXT.

### pierrea@email.com suggests:- (Needs testing) - SDriverMysql should have its own quoteIdentifier using ` instead of " (the character next to the 1 button above the tab button on a std US keyboard). The double quotation fails for the tablenames.

- SDriverMysql should be updated with a new driverName: MySQL-AB JDBC Driver. This is the driver name for all mysql jdbc drivers as posted on Mysql developer section. It might be worthwhile to change the driverName function to return an array of possible names instead of a single name, either that or subclass SDriverMysql to SDriverMMMysql and then include both.

  • Constructor Details

    • SDriverMySQL

      public SDriverMySQL()
  • Method Details

    • driverName

      protected String driverName()
      Description copied from class: SDriver
      The driver name to be compared to getMetaData().getDriverName()
      Overrides:
      driverName in class SDriver
    • appendQuotedIdentifier

      protected void appendQuotedIdentifier(String ident, StringBuffer buf)
      Description copied from class: SDriver
      Wraps identifiers in "s to avoid reserved word issues. (Override this for dbs that use different chars, eg [xxx] for MS-SQL. We do quote these days to avoid the endless problems with reserved words.
      Overrides:
      appendQuotedIdentifier in class SDriver
    • postTablePostParenSQL

      protected String postTablePostParenSQL(SRecordMeta meta)
      Any other text to be added after the final ")"
      Overrides:
      postTablePostParenSQL in class SDriver
    • supportsLocking

      public boolean supportsLocking()
      ### This assuems their "innoDB" mode. Not true for traditional MySQL. Needs work.
      Overrides:
      supportsLocking in class SDriver
    • indexKeySQL

      protected String indexKeySQL(SRecordMeta meta)
      Returns INDEX (KCOL) Apparently MySQL needs the index to be created as part of the Create Table statement or it generates errors. I don't think any other DBs support INDEX clauses.
      Overrides:
      indexKeySQL in class SDriver
    • makeForeignKeyIndexSQL

      protected void makeForeignKeyIndexSQL(SRecordMeta meta, int fx, SFieldReference fldRef, StringBuffer sbFkey, StringBuffer sbRefed, StringBuffer fkey)
      Overrides:
      makeForeignKeyIndexSQL in class SDriver