kvarnerexpress 0 Report post Posted January 29, 2005 I get the following error while trying to connect to SQL Server using JSP.Login failed for user 'prashanti'. Reason: Not associated with a trusted SQL Server connection.My code is as follows:<html><head></head><body><%@ page import="java.sql.*" %><% Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance(); %><% Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433","prashanti","prashanti"); Statement stmt = conn.createStatement();ResultSet columns = stmt.executeQuery("select * from employee");while(columns.next()){String name = columns.getString("name");String address = columns.getString("address");%><%=name%><%}%></body></html>Any help will be appreciated.Thanks, Share this post Link to post Share on other sites
bjrn 0 Report post Posted January 30, 2005 Login failed for user 'prashanti'. Reason: Not associated with a trusted SQL Server connection.Okay. I am assuming this isn't on Xisto because as far as I know we only get MySQL and postgress databases here. If you have access to the sql server and are allowed to change settings you have to change the authentication mode in the SQL server properties from "Windows only" to "SQL Server and Windows". This is not a java/jsp problem, you would probably get that error with any app you make. Hope this helps, otherwise google came up with quite a lot of results. Good luck. Share this post Link to post Share on other sites
Keeper 0 Report post Posted February 1, 2005 I'm using following sintax for connects to the Oracle database from JSP (Tomcat 5.0) DbConnectionPool dbpool; dbpool = new DbConnectionPool( "oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:temp/temp@192.168.0.1:1521:temp", "", ""); Connection conn; Statement stmt; conn = (Connection)dbpool.getConnection(20000); stmt = conn.createStatement();and after this text u can use created statment for getting resultsets etc.... ResultSet rs = stmt.executeQuery( "SELECT * " + "FROM table where param1 = '" + param1 + "' and param2 = '" + param2 + " ' "); Good luck with it... it's for oracle database but i thk creating connections is same in other driver... Share this post Link to post Share on other sites