You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class SalesforceTest {
public static void main(String[] args) {
try {
Connection con = null;
Class.forName("com.ascendix.jdbc.salesforce.ForceDriver");
con = DriverManager.getConnection(
"jdbc:ascendix:salesforce://[loginDomain=https://login.salesforce.com/services/oauth2/authorize;DatabaseName=SFORCE;[email protected];password=somepassword]");
Statement pstmt = con.createStatement();
ResultSet rs = pstmt.executeQuery("SELECT COUNT(*) FROM SFORCE.ACCOUNT");
while (rs.next()) {
System.out.println(rs.getString(1));
}
}catch(ClassNotFoundException cfe) {
cfe.printStackTrace();
}catch(SQLException se) {
se.printStackTrace();
}catch(Exception e) {
e.printStackTrace();
}
}
}
I am using above class and the saleforce jdbc jar which is downloaded from here but I am getting the following error
java.sql.SQLException: [LoginFault [ApiFault exceptionCode='INVALID_LOGIN'
exceptionMessage='Invalid username, password, security token; or user locked out.'
extendedErrorDetails='{[0]}'
]
]
at com.ascendix.jdbc.salesforce.ForceDriver.connect(ForceDriver.java:53)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
at SalesforceTest.main(SalesforceTest.java:14)
Caused by: [LoginFault [ApiFault exceptionCode='INVALID_LOGIN'
exceptionMessage='Invalid username, password, security token; or user locked out.'
extendedErrorDetails='{[0]}'
]
]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:673)
at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:556)
at com.sforce.ws.transport.SoapConnection.parseDetail(SoapConnection.java:236)
at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:210)
at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:156)
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:99)
at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:818)
at com.sforce.soap.partner.PartnerConnection.<init>(PartnerConnection.java:427)
at com.sforce.soap.partner.Connector.newConnection(Connector.java:28)
at com.ascendix.jdbc.salesforce.ForceConnection.getConnectionByUserCredential(ForceConnection.java:93)
at com.ascendix.jdbc.salesforce.ForceConnection.getPartnerConnection(ForceConnection.java:51)
at com.ascendix.jdbc.salesforce.ForceDatabaseMetaData.<init>(ForceDatabaseMetaData.java:28)
at com.ascendix.jdbc.salesforce.ForceConnection.<init>(ForceConnection.java:38)
at com.ascendix.jdbc.salesforce.ForceDriver.connect(ForceDriver.java:51)
... 3 more
Any help would be greatly appreciates, and the same username is working when I am going through the login.salesforce.com.
The text was updated successfully, but these errors were encountered:
I am using above class and the saleforce jdbc jar which is downloaded from here but I am getting the following error
Any help would be greatly appreciates, and the same username is working when I am going through the login.salesforce.com.
The text was updated successfully, but these errors were encountered: