Filtering Unwanted Projects In Eclipse

Well, after a while developing on Eclipse; you seem to have a lot of projects in your Package Explorer.

Yep; you can filter them by clicking on the "View Menu" icon(or by pressing Ctrl+F10) and selecting the "Filters…" option from there; but all you get is to filter projects that you don’t want to see.

What if I want to filter the projects that I want to see? Yeah, I know, they probably wanted you to create a Working Set and filter the projects according to that.(Which is a good way of achieving this purpose by the way)

Still though, do you want to be able to filter the projects that you wanted to see?(and still be able to filter using Working Sets of course)

Read the rest of this entry »

Advertisements

Get Last Inserted Id in a Table using Spring Framework and MySQL

int insert(final String a,final int b) {

KeyHolder keyHolder = new GeneratedKeyHolder();
this.getJdbcTemplate().update(new PreparedStatementCreator() {

@Override
public PreparedStatement createPreparedStatement(Connection conn)
throws SQLException {
// TODO Auto-generated method stub
PreparedStatement ps=conn.prepareStatement(“insert into table(a,b) values(?,?)”, new String [] {“id”});
ps.setString(1, a);
ps.setInt(2, b);

return ps;
}
}, keyHolder);

return keyHolder.getKey().intValue();

}

This example uses the Spring Framework’s classes though.

I have only tested it with MySQL (v5 to be specific), if you do try it with other databases; let me know if they work.

Change Tomcat Port

I just needed to do this, since Oracle 10g XE Web Interface also listens on port 8080.

After a quick lookaround in its folders, I found a way.

So here is how it is done:

Stop Tomcat.

Go to <Your Tomcat Directory>/conf/

Edit server.xml there.

There will be a Connector tag there.

<Connector port=”8082” protocol=”HTTP/1.1″
connectionTimeout=”20000″
redirectPort=”8443″ />

Change its port attribute to anything you like; in my case it is 8082 as you can see.

Restart Tomcat.

*Solution* – Cannot access Oracle 10g XE Home Page http://127.0.0.1:8080/apex on Windows XP

I have just installed a brand new Oracle 10g XE and just after installation, I was not able to access the home page.

When I executed the "lsnrctl status" command I got this output:

C:\Documents and Settings\me>lsnrctl status

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 – Production on 19-ÌUB-2009 00:01:03

Read the rest of this entry »

*Solution* – When I right click a file in Windows explorer.exe crashes

Right Click MenuI just had this annoying problem which seems to only happen when I right click *some, but not all* files. If you also have this problem, you have come to the right place because I actually found a way to solve it! 🙂

Right Click Menu

The problem is that one of your shell extensions has some problems loading when you right click on those particular files. Just install ShellExView and you will be able to see all your shell extensions. All you have to do is just disable the shell extensions of those applications that you have recently installed. Do it one by one, and you will find which extension is causing up the damn trouble! In my case it was the latest version of TortoiseSVN, but people around seem to be also having problems with other software too.

Normally, I would recommend using Fast Explorer 2008, as it also has the ability to show all extensions residing on your system and *more*; but what it doesn’t have is the ability to sort the shell extensions by their “File Created Time”. IMO, this is a great feature to have in an application like this. So I am hailing the developers from here to also include it 🙂

As always, there may happen to be another cause for these explorer crashes, although these are the most popular one as far as I have seen.

Oh and by the way, here is a more detailed walkthrough if you need any more help.