Jeg bruger MacroMedia Dreamweaver MX til at generere JSP-sider, og problemer er, at programmet siger, at der kan skabes forbindelse, men tabellerne er ikke tilgængelige.
<%@page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%
// FileName="Connection_jdbc_conn.htm"
// Type="JDBC" ""
// DesigntimeType="JDBC"
// HTTP="false"
// Catalog=""
// Schema=""
String MM_testdb3_DRIVER = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String MM_testdb3_USERNAME = "projektbruger";
String MM_testdb3_PASSWORD = "password";
String MM_testdb3_STRING = "jdbc:microsoft:
sqlserver://SPPORTABLE:1433;databasename=projektstyring"%>
<%
Driver DriverRecordset1 = (Driver)Class.forName(MM_testdb3_DRIVER).newInstance();
Connection ConnRecordset1 = DriverManager.getConnection(MM_testdb3_STRING,MM_testdb3_USERNAME,MM_testdb3_PASSWORD);
PreparedStatement StatementRecordset1 = ConnRecordset1.prepareStatement("SELECT * FROM dbo.projekter");
ResultSet Recordset1 = StatementRecordset1.executeQuery();
boolean Recordset1_isEmpty = !Recordset1.next();
boolean Recordset1_hasData = !Recordset1_isEmpty;
Object Recordset1_data;
int Recordset1_numRows = 0;
%>
<html>
<body>
<p><%=(((Recordset1_data = Recordset1.getObject("projektnavn"))==null || Recordset1.wasNull())?"":Recordset1_data)%></p>
</body>
</html>
<%
Recordset1.close();
StatementRecordset1.close();
ConnRecordset1.close();
%>