Changes for page Database Compatibility and Comparisons-FrontBase
Last modified by John Huss on 2010/07/23 14:35
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,4 +1,4 @@ 1 -FrontBase is now available for **free**. Please see the FrontBase website [[http://www.frontbase.com]] for details. 1 +FrontBase is now available for **free**. Please see the FrontBase website [[http:~~/~~/www.frontbase.com>>url:http://www.frontbase.com||shape="rect"]] for details. 2 2 3 3 ---- 4 4 ... ... @@ -5,9 +5,9 @@ 5 5 **A first experience with FrontBase, WO 5.3.1 and MacOSX 10.4.6** 6 6 7 7 Make sure you have the FrontBase jdbc connector accessible from your WebObjects applications. I placed mine in /Library/Java/Extensions/ 8 -Make sure that the FrontBasePlugIn.framework is located in /Library/Java/Frameworks 9 -Make sure that you have added the framework to your project or you will not be able to establish a connection to your database, even though you'll be able to see your database from EOModeler. 10 -If you haven't yet assigned a User/Password combination to your database, you still must include User information in order for the connection to be established. Use system to get started. The URL for basic connection is: jdbc:FrontBase:~/~/localhost/my_database_name 8 + Make sure that the FrontBasePlugIn.framework is located in /Library/Java/Frameworks 9 + Make sure that you have added the framework to your project or you will not be able to establish a connection to your database, even though you'll be able to see your database from EOModeler. 10 + If you haven't yet assigned a User/Password combination to your database, you still must include User information in order for the connection to be established. Use _system to get started. The URL for basic connection is: jdbc:FrontBase:~/~/localhost/my_database_name 11 11 12 12 The documentation available at the Frontbase site is very complete. The only gotcha was that I was left with the impression the framework was only necessary for WebObjects 4.5 and below. This is not the case, you have to install and include it for WO 5 projects too. 13 13 ... ... @@ -15,7 +15,7 @@ 15 15 16 16 **Useful SQL commands in FrontBase** 17 17 18 -{{code value="sql"}}18 +{{code 0="sql"}} 19 19 20 20 // writes an ascii backup of your database 21 21 write all output(dir='/path/to/export/dir', type = 'FrontBase', content=true); ... ... @@ -28,18 +28,13 @@ 28 28 29 29 {{/code}} 30 30 31 -{{color value="#000000"}} 32 -If you don't use type='FrontBase', you end up losing precision on your timestamp columns, which can really suck. 33 -{{/color}} 31 +(% style="color: rgb(0,0,0);" %)If you don't use type='FrontBase', you end up losing precision on your timestamp columns, which can really suck. 34 34 35 35 ---- 36 36 37 37 **Delimited Export From FrontBase** 36 + (% style="color: rgb(0,0,0);" %)Out of the box FrontBase doesn't provide a pure delimited file export. But it comes close, and with a little effort, you can have a delimited file export that you can import into a different database. This script will create a tab delimited backup of your database. 38 38 39 -{{color value="#000000"}} 40 -Out of the box FrontBase doesn't provide a pure delimited file export. But it comes close, and with a little effort, you can have a delimited file export that you can import into a different database. This script will create a tab delimited backup of your database. 41 -{{/color}} 42 - 43 43 {{code}} 44 44 45 45 #! /bin/bash ... ... @@ -123,19 +123,14 @@ 123 123 124 124 There are a few caveats with this backup: 125 125 126 -1. FrontBase's delimited export doesn't do any quoting or escaping as far as I know. The script above handles embedded quotes, but that is all. So if your data has embedded line breaks, tabs, or double-quotes, then you will need to manually deal with that. The easiest way is to just edit the data in the DB before backing up. First run a query to escape double quotes so that " becomes "". Then run a query to surround the data with double quotes. These changes will make the export file valid but won't alter the data once it's imported. 127 -1. FrontBase's export pads CHAR (fixed-length) fields with zero bytes (0x0) which are not allowed by Postgres' import. You can alter your schema to use VARCHAR instead before exporting, or just strip the zero bytes if you know that if won't mess up any other data you have. You can strip them after exporting by running this command: 128 - 129 -{{code}} 130 - 121 +1. FrontBase's delimited export doesn't do any quoting or escaping as far as I know. The script above handles embedded quotes, but that is all. So if your data has embedded line breaks, tabs, or double-quotes, then you will need to manually deal with that. The easiest way is to just edit the data in the DB before backing up. First run a query to escape double quotes so that " becomes "". Then run a query to surround the data with double quotes. These changes will make the export file valid but won't alter the data once it's imported. 122 +1. FrontBase's export pads CHAR (fixed-length) fields with zero bytes (0x0) which are not allowed by Postgres' import. You can alter your schema to use VARCHAR instead before exporting, or just strip the zero bytes if you know that if won't mess up any other data you have. You can strip them after exporting by running this command: 123 +1. {{code}} 131 131 tr -d '\0' < MyTable.tab > MyTableStripped.tab 132 132 mv MyTableStripped.tab MyTable.tab 133 - 134 -{{/code}} 135 - 136 -1. I don't know if this works with binary data. 126 +{{/code}}I don't know if this works with binary data. 137 137 1. There may be issues with character encoding. 138 -1. There may be issues with timestamp precision. 128 +1. There may be issues with timestamp precision. Is type='FrontBase' needed? 139 139 140 140 ---- 141 141 ... ... @@ -237,10 +237,10 @@ 237 237 238 238 In most cases the datatypes are exactly the same. Here are the FrontBase equivalents for common datatypes in MySQL that are different: 239 239 240 -TEXT -> CLOB 230 +TEXT ~-~-> CLOB 241 241 242 -DATETIME -> TIMESTAMP 232 +DATETIME ~-~-> TIMESTAMP 243 243 244 -INT -> INTEGER 234 +INT ~-~-> INTEGER 245 245 246 -MEDIUMBLOB -> BLOB 236 +MEDIUMBLOB ~-~-> BLOB