im failing to connect a sql server db to a spring boot application

i have this in application.properties but the table dont update
No description
159 Replies
JavaBot
JavaBot4mo ago
This post has been reserved for your question.
Hey @✞rumy✞! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
ayylmao123xdd
ayylmao123xdd4mo ago
can you test the connection are you using intellij ultimate or no
✞rumy✞
✞rumy✞OP4mo ago
yes i am
ayylmao123xdd
ayylmao123xdd4mo ago
so you can check with the database view if you are connected to the database if you havent you can connect to the database with this db view
✞rumy✞
✞rumy✞OP4mo ago
No description
✞rumy✞
✞rumy✞OP4mo ago
are thry supposed to appear in tables?
ayylmao123xdd
ayylmao123xdd4mo ago
wrong view i mean the intellij database view on the right side of intellij where you got maven view too
✞rumy✞
✞rumy✞OP4mo ago
wait im trying xd
✞rumy✞
✞rumy✞OP4mo ago
No description
ayylmao123xdd
ayylmao123xdd4mo ago
you need to add the icon i forgot how lol i think in the view tab click file view the 3 lines - - - and in view tool windows database and it should appear
✞rumy✞
✞rumy✞OP4mo ago
right or left
ayylmao123xdd
ayylmao123xdd4mo ago
which thing the 3 lines top left next to project name
✞rumy✞
✞rumy✞OP4mo ago
aa okay
✞rumy✞
✞rumy✞OP4mo ago
No description
✞rumy✞
✞rumy✞OP4mo ago
doesnt appear ((
ayylmao123xdd
ayylmao123xdd4mo ago
Enable the Database Tools and SQL plugin This functionality relies on the Database Tools and SQL plugin, which is bundled and enabled in IntelliJ IDEA by default. If the relevant features are not available, make sure that you did not disable the plugin. The Database Tools and SQL plugin is not available in IntelliJ IDEA Community Edition. Press Ctrl+Alt+S to open settings and then select Plugins. Open the Installed tab, find the Database Tools and SQL plugin, and select the checkbox next to the plugin name. try what this guide says
✞rumy✞
✞rumy✞OP4mo ago
its not available in the community edition? cause thats what i have
ayylmao123xdd
ayylmao123xdd4mo ago
:SkullPixel: well if u said no here that would save us a lot of time l0l
✞rumy✞
✞rumy✞OP4mo ago
oh sorry (( i thought i had it
ayylmao123xdd
ayylmao123xdd4mo ago
anyway
✞rumy✞
✞rumy✞OP4mo ago
then, what db service can i use for free
ayylmao123xdd
ayylmao123xdd4mo ago
idk i use the ultimate version you sure you dont need to put the username and password things in your config
✞rumy✞
✞rumy✞OP4mo ago
i tried that as well
ayylmao123xdd
ayylmao123xdd4mo ago
did you add the dependency in pom for your database type
✞rumy✞
✞rumy✞OP4mo ago
yes, but it says vulnerability found in dependency
ayylmao123xdd
ayylmao123xdd4mo ago
ok show the connection properties in the database tool
✞rumy✞
✞rumy✞OP4mo ago
No description
ayylmao123xdd
ayylmao123xdd4mo ago
do you get any error when you start the application saying cant connect
✞rumy✞
✞rumy✞OP4mo ago
i get login failed
ayylmao123xdd
ayylmao123xdd4mo ago
u gotta put the proper login then
✞rumy✞
✞rumy✞OP4mo ago
No description
ayylmao123xdd
ayylmao123xdd4mo ago
what does it say in connection parameters and the login page
✞rumy✞
✞rumy✞OP4mo ago
No description
✞rumy✞
✞rumy✞OP4mo ago
its windows auth
ayylmao123xdd
ayylmao123xdd4mo ago
change it to uhhhhhhhhh login and password
✞rumy✞
✞rumy✞OP4mo ago
No description
✞rumy✞
✞rumy✞OP4mo ago
sql auth?
ayylmao123xdd
ayylmao123xdd4mo ago
yea try that
✞rumy✞
✞rumy✞OP4mo ago
No description
ayylmao123xdd
ayylmao123xdd4mo ago
u should pick the option create new connection tho ok wait let me check something
✞rumy✞
✞rumy✞OP4mo ago
oki but since i have community can i use sql server? or i should pick another
ayylmao123xdd
ayylmao123xdd4mo ago
actually in username type your windows account username and in password your windows password
✞rumy✞
✞rumy✞OP4mo ago
i dont have a password for my pc
ayylmao123xdd
ayylmao123xdd4mo ago
then dont type anything there just the login
✞rumy✞
✞rumy✞OP4mo ago
oki
ayylmao123xdd
ayylmao123xdd4mo ago
and run the app and see if you get the same error
✞rumy✞
✞rumy✞OP4mo ago
what do i do int the db login?
ayylmao123xdd
ayylmao123xdd4mo ago
just login like you normally do
✞rumy✞
✞rumy✞OP4mo ago
No description
ayylmao123xdd
ayylmao123xdd4mo ago
disaster ok lets ask special forces of java help@dan1st | Daniel cuz i gtg cant auth to microsoft sql server thru windows authentication i think its missing the exe
dan1st
dan1st4mo ago
Both on the same device or on different devices?
✞rumy✞
✞rumy✞OP4mo ago
oki, but thank u a lot still
JavaBot
JavaBot4mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
✞rumy✞
✞rumy✞OP4mo ago
both on the same
dan1st
dan1st4mo ago
Are you connecting via JDBC or differently?
✞rumy✞
✞rumy✞OP4mo ago
noo idea
dan1st
dan1st4mo ago
How are you connecting to SQL server? From what application?
✞rumy✞
✞rumy✞OP4mo ago
intellij
dan1st
dan1st4mo ago
Can you check the answers here? https://stackoverflow.com/q/6087819/10871900
✞rumy✞
✞rumy✞OP4mo ago
sqljdbc_auth.dll so i downloaded this but idk where to put it in my files
dan1st
dan1st4mo ago
I think you need it in the java.library.path Can you edit the JVM arguments used for the JDBC driver?
✞rumy✞
✞rumy✞OP4mo ago
what does that mean im sorry im a beginner 😭
dan1st
dan1st4mo ago
What are the options for configuring the JDBC driver?
✞rumy✞
✞rumy✞OP4mo ago
im sorry i dont know where to search that ((
dan1st
dan1st4mo ago
Can you shwo the dialog where you configured the DB connection?
✞rumy✞
✞rumy✞OP4mo ago
i dont have the db option in tools i have the free version
dan1st
dan1st4mo ago
?
✞rumy✞
✞rumy✞OP4mo ago
not the one in view?
dan1st
dan1st4mo ago
idk what you mean with in view There was something where you configured what DB to connect to, right?
✞rumy✞
✞rumy✞OP4mo ago
aplication.properties?
✞rumy✞
✞rumy✞OP4mo ago
No description
dan1st
dan1st4mo ago
Are you connecting to the DB from a Java application?
✞rumy✞
✞rumy✞OP4mo ago
intellij
dan1st
dan1st4mo ago
Either it's IntelliJ connecting to the DB or it's the application connecting to the DB YOur screenshot looks like the latter
✞rumy✞
✞rumy✞OP4mo ago
thats wrong? should i modify smth?
dan1st
dan1st4mo ago
First take the sqljdbc_auth.dll and copy it to some directory and save the path of that directory then open the run configuration in IntelliJ
✞rumy✞
✞rumy✞OP4mo ago
oki and now?
dan1st
dan1st4mo ago
which step?
✞rumy✞
✞rumy✞OP4mo ago
No description
dan1st
dan1st4mo ago
expand the "Application" thing
✞rumy✞
✞rumy✞OP4mo ago
i copied the path where isaved that okay
dan1st
dan1st4mo ago
Can you show what you see now?
✞rumy✞
✞rumy✞OP4mo ago
No description
dan1st
dan1st4mo ago
can you click on the thing that appeared?
✞rumy✞
✞rumy✞OP4mo ago
No description
dan1st
dan1st4mo ago
Click on "Modify options"
No description
dan1st
dan1st4mo ago
there should be something like "VM arguments" or "JVM arguments"
✞rumy✞
✞rumy✞OP4mo ago
No description
✞rumy✞
✞rumy✞OP4mo ago
i added vm options
dan1st
dan1st4mo ago
enter -Djava.library.path=THE_PATH_YOU_COPIED ofc replace THE_PATH_YOU_COPIED with the path of the folder of the DLL file
✞rumy✞
✞rumy✞OP4mo ago
okay done
dan1st
dan1st4mo ago
then restart the application
✞rumy✞
✞rumy✞OP4mo ago
restart?
dan1st
dan1st4mo ago
run the application again
✞rumy✞
✞rumy✞OP4mo ago
aa oki
✞rumy✞
✞rumy✞OP4mo ago
No description
✞rumy✞
✞rumy✞OP4mo ago
No description
✞rumy✞
✞rumy✞OP4mo ago
this is the path i put oh waitt
dan1st
dan1st4mo ago
put it in a folder without spaces and update it in the VM options
✞rumy✞
✞rumy✞OP4mo ago
okay im waiting to see if it has errors again
✞rumy✞
✞rumy✞OP4mo ago
No description
✞rumy✞
✞rumy✞OP4mo ago
No description
dan1st
dan1st4mo ago
What do you have in your VM options?
✞rumy✞
✞rumy✞OP4mo ago
-Djava.library.path=C:\Users\kiko\Desktop\proiect\sqljdbc_12.10
dan1st
dan1st4mo ago
it seems like you need to download mssql_jdbcauth-12.4.2.x64.dll Also you could try adding ;authenticationScheme=NTLM to the JDBC URL in the application.properties but idk whether that would change anything
✞rumy✞
✞rumy✞OP4mo ago
thats not free right?
dan1st
dan1st4mo ago
?
✞rumy✞
✞rumy✞OP4mo ago
mssql_jdbcauth-12.4.2.x64.dll
dan1st
dan1st4mo ago
I thought it would be freely available but I don't know MSSQL I think you can just add this dependency: https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc_auth/12.4.2.x64
✞rumy✞
✞rumy✞OP4mo ago
there s an error
✞rumy✞
✞rumy✞OP4mo ago
No description
dan1st
dan1st4mo ago
it belongs inside the <dependencies> section along with the other dependencies
✞rumy✞
✞rumy✞OP4mo ago
No description
dan1st
dan1st4mo ago
press Ctrl twice and enter mvn compile this should download the dependency automatically and then you can reload the project in IntelliJ
✞rumy✞
✞rumy✞OP4mo ago
No description
dan1st
dan1st4mo ago
Can you show the full output?
dan1st
dan1st4mo ago
✞rumy✞
✞rumy✞OP4mo ago
No description
dan1st
dan1st4mo ago
just put the file in the same directory as the other DLL and don't run it
✞rumy✞
✞rumy✞OP4mo ago
and now?
✞rumy✞
✞rumy✞OP4mo ago
No description
dan1st
dan1st4mo ago
then run your application again Wasn't there another DLL before? sqljdbc_auth I think
✞rumy✞
✞rumy✞OP4mo ago
it was the other one i downloaded
dan1st
dan1st4mo ago
yeah put it in the same directory as sqljdbc_auth
✞rumy✞
✞rumy✞OP4mo ago
No description
dan1st
dan1st4mo ago
both DLLs in the same folder that's als used for the java.library.path
✞rumy✞
✞rumy✞OP4mo ago
No description
✞rumy✞
✞rumy✞OP4mo ago
No description
✞rumy✞
✞rumy✞OP4mo ago
wait both?
✞rumy✞
✞rumy✞OP4mo ago
No description
dan1st
dan1st4mo ago
one folder with the two DLL files in it
✞rumy✞
✞rumy✞OP4mo ago
i only downloaded one
dan1st
dan1st4mo ago
the mssql-jdbc-auth one and the sqljdbc_auth one though I'm not sure whether the second one is actually needed
✞rumy✞
✞rumy✞OP4mo ago
wait where do i put it?
dan1st
dan1st4mo ago
in some folder without any spaces doesn't matter where and then you update the java.library.path accordingly
✞rumy✞
✞rumy✞OP4mo ago
i cant find it
dan1st
dan1st4mo ago
find what?
✞rumy✞
✞rumy✞OP4mo ago
No description
✞rumy✞
✞rumy✞OP4mo ago
cant find the java.library
dan1st
dan1st4mo ago
java.library.path is the thing in the VM options
✞rumy✞
✞rumy✞OP4mo ago
oh wait so what do i put there?
✞rumy✞
✞rumy✞OP4mo ago
No description
✞rumy✞
✞rumy✞OP4mo ago
is it where it should be?
dan1st
dan1st4mo ago
in some folder, doesn't matter which one
✞rumy✞
✞rumy✞OP4mo ago
okay, now run?
dan1st
dan1st4mo ago
now you copy the path of that folder with the DLL file, edit the VM ptions and edit the java.library.path accordingly
✞rumy✞
✞rumy✞OP4mo ago
but if they re in the same folder
dan1st
dan1st4mo ago
Can you show me?
✞rumy✞
✞rumy✞OP4mo ago
. its in the same place like the previous one
dan1st
dan1st4mo ago
Can you show the java.library.path=?
✞rumy✞
✞rumy✞OP4mo ago
-Djava.library.path=C:\Users\kiko\Desktop\proiect\sqljdbc_12.10
dan1st
dan1st4mo ago
the DLL is in the enu folder so it would need to be -Djava.library.path=C:\Users\kiko\Desktop\proiect\sqljdbc_12.10\enu
✞rumy✞
✞rumy✞OP4mo ago
aa my bad
✞rumy✞
✞rumy✞OP4mo ago
i think i should use another db xd but thank you so much for the help
JavaBot
JavaBot4mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
JavaBot
JavaBot4mo ago
Post Closed
This post has been closed by <@619481763382558731>.

Did you find this page helpful?