How to get an 18 digit ID from 15 digit ID using SOQL
To convert it to 18 digits you can simply set it to an Id
type variable:
Id someId = '001J000001eun1Q';
Which will automatically convert it for you:
system.debug(someId); // 001J000001eun1QIAQ
Then you can simply call the getSObjectType()
method on the Id variable which will return the object name:
Schema.SObjectType objectType = someId.getSObjectType();
system.debug(objectType); // Account