Friday, February 7, 2014

DatabaseName is the name of the database I DSSHOUSE-2, not sure the name of the database or the mac


After a long hiatus Poured into the workflow metafrasi Today I took a little too. For people who want to connect to the database using JSP. There are many steps, but I will give a simple summary of it Weau you what to do. But first, you must Equipment as follows (to be easy) Netbeans metafrasi 6.5 with Java EE plugin SQL Server 2005 Express Edition with Tools of it, Microsoft SQL Server 2005 JDBC Driver.
When you have all 3 and then to create a Web Application project in Netbeans metafrasi done, we add to the Library Project is sqljdbc.jar This time we started how to do it by the Code is an example on <%. @ page contentType = "text / html; charset = utf-8" language = "java" import = "java.sql. *" errorPage = ""%> <! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.01. Transitional / / EN "" http://www.w3.org/TR/html4/loose.dtd "> <html> <head> <meta http-equiv =" Content-Type "content =" text / html; charset. = UTF-8 "> <title> JSP Page </ title> </ head> <body> <h1> Hello World! </ h1> <% Class.forName (" com.microsoft.sqlserver.jdbc.SQLServerDriver "). ; Connection con = DriverManager.getConnection ("jdbc: sqlserver :/ / localhost: 1433; user = domesterz; password = 1234;"); Statement cstmt = con.createStatement (); ResultSet rs = cstmt.executeQuery ("SELECT * FROM. users "); if (con! = null) {if (rs! = null) {while (rs.next ()) {String user = rs.getString (" username "); String password = rs.getString (" password. "); out.print (user); out.print (password);}}} else {out.println (" metafrasi Connect Database Failed ");} metafrasi con.close ();%> </ body> </ html>.
This Code and really deserved to connect metafrasi to the database. But not for me We may see Error lot like TCP / IP something I go to open Port 1433 (if it uses the example) in SQL Configuration Management -> SQL Server 2005 Network Configuration -> TCP / IP to the IP. Addresses -> IPAll the Port, wrote in 1433 but never finished it.
It usually takes us Install SQL Server 2005 first time we get into the database Windows metafrasi Authenticate, so we need to create the Account to muted SQL Authenticate in SQL Server Management Studio Express (this one is for me a version Express is the word Express). Then we connect a Windows Authenticate previously logged Security -> press mouse the subjective opinion of the Logins select New Login, then enter the username to change the SQL Authenticate select Database, Language metafrasi indulge, but for version Express, we must remove the "User must change password. at next login "is because in Express Feature otherwise press OK on the Error.
When a User, do not find it immediately. In the database, we have the right to access information. So we need to set the User of us has the right to access the Database of us to solve the Database of it by mouse right-Database of me and then select Properties -> Permissions and then see User on us. rebuilt This time I try to do to make this user do it. I chose just by the main SELECT INSERT UPDATE DELETE metafrasi ceremony finished Run App Now let's try the Database Towers at it.
Help too
DatabaseName is the name of the database I DSSHOUSE-2, not sure the name of the database or the machine name exactly it. But it must be the name of the database into that I was a "really be" me a little wary.
Home History Dominic.

No comments:

Post a Comment