0

This is the first time I'm connecting to a database so I am sorry if it's a stupid question but I am trying to follow tutorial or something but every one already starts where creating a Connection object is possible while I can't create it. IntelliJ doesn't recognize it and I can't import anything specific related to sql.

enter image description here

What did I miss?

JurajC
  • 99
  • 2
  • 8
  • Are you importing the package? Try adding "import java.sql.Connection" to the file. – Ryan Jan 13 '22 at 14:28
  • no, just this, https://i.imgur.com/YdwHeNO.png – JurajC Jan 13 '22 at 14:30
  • I think there is something wrong with your IDE. See https://stackoverflow.com/questions/26952078 – Stephen C Jan 13 '22 at 14:33
  • So since I am on macOS, Mac M1, I had to use Java 16 in order to have functional JavaFX. When I try to create a normal project on Java 17 I can import Connection, Driver manager etc. but then JavaFX won't work :/ – JurajC Jan 13 '22 at 14:48
  • you need to add a * to that. but you should import only Connection since that's what you're using. – Ryan Jan 13 '22 at 15:38

0 Answers0