Notepad is not a compiler, it's a text editor used for typing in Java code. If you are just starting out, I'd recommend grabbing any text editor which highlights the code for you along with smart indentation. There are a lot of options in there: Notepad++, Gedit, Scite etc. I've also heard good things about "Programmer's Notepad".
If yo are new to Java then a full-featured IDE like NetBeans or Eclipse is not a good idea. It will overwhelm you with features you don't understand yet, and block your progress by making suggestions and corrections that you haven't learned yet.
For now, just stick with a good editor and the standard JDK compiler.
If you are new to java,make sure that you don't start with ide's like eclipse,netbeans,etc..
I did the same mistake when i started, the reason i am saying this is because these 2 ide make your job very easy.I would prefer gedit for people who are just starting out with java.It's just like text editor but with lots of advanced features.
Dim Adapter As New OleDbDataAdapter
Dim Command As New OleDbCommand
Dim xFrom As String = dtpFrom.Value.ToString.Substring(0, dtpFrom.Value.ToString.IndexOf(" "))
Dim xTo As String = dtpTo.Value.ToString.Substring(0, dtpTo.Value.ToString.IndexOf(" "))
sqlQuery = MainQuery ...