9
Aug/09
0

mysql connector jar not found: the fix

Whilst setting up the MySQL Connectivity in MyEclipse, this error message cropped up.

mysql connector jar not found

Simple fix is to get it from the MySQL website!

Filed under: MyEclipse
8
Aug/09
0

Windows Vista/7 : Placing New User Accounts on a seperate partition

One of the irksome things with Windows is being able to place the entire user account subdirectory onto a seperate partition. Not just the Documents and Music folders (which you can move by right-clicking on and changing locations using the Properties dialog), but the whole shebang. This whole shebang is referred to as a ‘User Profile’.

I recently had the fortune to purchase a new laptop – a Sony Vaio BZ21VN – C2D P8700 2.53Ghz 4 Gb 400 Gb DVDRWDL 15.4 inch X-BLACK Vista Biz if you are interested – and thought I’d sort this out from the start.

Windows by default stores the User Profile under C:\Users – this is what used to be Documents and Settings under XP. The account created on startup will be placed there – so I called my initial account ‘Install’ – you have the freedom of keeping or disposing of this later as you like.

Once you’ve set up and updated Windows, clicked the 742 licence agreements and gone through the 16 restart cycles we can start dealing with the User Account location issue.

MAKE SURE YOU CREATED RESTORE DISKS OR HAVE YOUR INSTALL DISKS TO HAND  IN CASE SOMETHING GOES WRONG. NO LIABILITY ACCEPTED FOR THINGS THAT GO WRONG HERE!!!

Sort out the desired location of the user files

It can be either a second hard disk or a partition that you’ve created. Partitions can be created by going to Control Panel and typing in Partitions in the Search Panel to get to the Partition tool. (I like this tool a lot!).

Partitioning now feels a lot less scary than it used to be. Remember the C: drive will be for Windows and your programs you install – so give that an appropriate size to match – I use 100G for that. I also called the location of my user accounts the U: drive.

3
Aug/09
0

VisualWeb JSF being discontinued

One of the primary reasons for starting this blog was to log any nifty tricks I learnt whilst using Netbeans and VisualWeb JSF. However this has now been converted to a non-essential Sun item. I was also planning to document IceFACES, an AJAX support framework, which no longer supports a Visual developer setup with Netbeans 6.7 due to the removal of the ‘Woodstock’ components for the core IDE. Being new with IceFACES from within a text editor looses the productivity gains it should provide.

As I have some projects looming up and have to think about maintenance down the line, I have decided to make the switch to Eclipse – specifically I am using the MyEclipse platform. Its not free as in beer, but comes with lots of neat addons tied in with it, so I am putting this through its paces.

7
Jul/09
1

sun.misc.BASE64Encoder replacement required

The package sun.misc.BASE64Encoder that was used in some code I was referencing came up with a warning: sun.misc.BASE64Encoder is Sun proprietary API and may be removed in a future release

Not good for futureproofing!

Its replacement can be found using the relevant class from Apache Commons library. This is in the Codec suite of the Apache Commons library.

Filed under: Java
3
Jul/09
1

VisualWeb JSF: linking form elements to a database (Part I:Displaying)

One of the advantages of using the VisualWeb JSF framework in Netbeans is that it makes the process of storing user data submitted in a web page form easy to store into a database.

The Prep Work

The first thing to do is to ensure your database has been setup with the tables required, and a user that can add data to a table has also been created. This is something I will add in a future post at some point.

As a start point you should have the VisualWeb JSF plugin installed to your copy of Netbeans 6 and created a web application that uses the VisualWeb JSF framework.

Two pages need to created for this application. By default there is a ‘Page1.jsp’ and supporting files created with the application. Add a second page by right clicking on ‘Web Pages’ and choose ‘New -> Visual Web JSF Page’. Label this ‘Page2.jsp’.

Create the form on Page 1 by opening up Page1.jsp. Ensure you are in the Design View for the page. The Woodstock pallette contains the item to use. A full rundown of all the components is available here – we are going to use the input text field and a submit button.

Part I

The first fun thing to do would be to populate an element from your database.

  • In the Services Tab, ensure the database you have chosen is connected.
  • Drag a listbox over from the Woodstock Basic Panel across to the page. By default it will be filled with ‘Item 1, Item 2 and Item3′, which we want to change to something from a database.
  • Give it a label in the Appearance section of the Properties window.
  • In the Services tab, go to the table whose data you want to be included in the list box.
  • Drag this table into the page.
  • Right click on the ListBox Item and right click on it. Choose ‘Bind To Data’ from the menu that appears.
  • In the ‘Bind To Data Provider’.
  • Choose the table and column you wish to display in the table.
  • Now when you deploy and run the application in your browser the information should appear in the table

30
Jun/09
2

Cyrillic Letters Turning Into Question Marks in WordPress

The Problem

One client had the requirement of having an English language blog, but with a few words of Russian thrown in for good measure. However, as soon as she tried to save any of her posts, any characters in the Cyrillic script (i.e. the strange Russian ones) were converted into question marks. What was the cause of this? Hunting and scouring initially produced no useful results – all the documentation pointed to WordPress being able to handle such letters and searches based on WordPress and Russian as keywords just produced localisation projects converting the whole WordPress interface into Russian. Or it was stuff in Russian that I didn’t understand. Eventually I stumbled upon a discussion on the WordPress forums that explained it all – the issue was in the database.

The Solution

The issue was that Fantastico scripts used to create the database structure (as opposed to using the wordpress standard install scripts) gave databases in format latin1_swedish_ci (the later gives utf8_general_ci). As the blog hadn’t been used I just recreated it with the standard install and it was fine. A fix requiring preservation of existing data might be to back up the database (Tools->Export) in the admin interface, delete and recreate WordPress with the correct tables and then see what happens!

Just goes to show that the famous WordPress 5-minute install script is the way to go (even if the file upload take more time)!

Want to learn more about WordPress? Browse WordPress Books!