Since you have prior programming knowledge of Java, then you can learn Java easily.
Java is programming language which is object oriented and used in writing of enterprise applications.
You should first learn Java programming and after that you can learn SQL.
Learning Java first is important its the base for development of applications.
You can learn Core Java first which includes topics like Basics of Java, Making simple programs, working with classes etc.
After learning core Java you can learn JDBC and at that time learning SQL will be beneficial.