Fasting hyperglycemia can happen with both type 1 and type 2 diabetes. Type 1 diabetes is caused by lack of insulin and the treatment is injected insulin, exercise and careful management of diet.
Type 2 is initially caused by insulin resistance and there will initially be high levels of insulin that cannot be properly used by the body. Treatment can be diet, exercise, weight loss, and medications. If type 2 is very long term the pancreas can "burn out" and then there will also be lack of insulin. Injected insulin will also be required, but it is still very important to address the insulin resistance to reduce the injected insulin requirements.