java - I am using Microsoft SQL Server 2014 and NetBeans 8.0.2 - getConnection always underlined RED -


i'm hoping can me?

i'm working on application programmed in netbeans 8.0.2 , have sql server 2014 backend database application.

i trying netbeans app talk sql database app , although feel have run processes of creating linking etc. correctly, cannot getconnection state apart underlined red.

any , appreciated.

i have added call below:

connection con = null;    try {     class.forname("com.microsoft.sqlserver.jdbc.sqlserverdriver");     con = drivermanager.getconnection("jdbc:sqlserver://localhost:1433;databasename=keyprop","sa");     system.out.println("connected"); } catch(classnotfoundexception e) {     system.out.println("class not found exception :" + e.getmessage()); } 

thanks, don

the problem trying call getconnection method not exist (getconnection(string, string)).

you have following choices:

so solution use

getconnection("jdbc:sqlserver://...", "sa", "your-sa-password) 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -