all groups > sql server (alternate) > march 2004 >
You're in the

sql server (alternate)

group:

From MySQL to MSSQL


From MySQL to MSSQL Jason
3/30/2004 10:18:59 PM
sql server (alternate): Hi, all,
I have a simple jsp page which conneced to mysql database with no problem, but
after I changed to production database server, MSSQL, I got nothing returned. I
did changed jdbc drive, etc., please help. Thanks in advance.

For example:
in MySQL:
--------------------------
20040301 010203

in MSSQL
--------------------------


<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ page import="java.sql.*" %>

<%
String connectionURL =
"jdbc:microsoft:sqlserver://DBServer:1433/Tracking;User=user;Password=pw";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;

String sSQLString="SELECT * FROM Tracking";
%>

<html>
<head>
<title>
Report
</title>
</head>
<body bgcolor="#ffffc0">
<hr>

<table width="100%" border="1">
<% try {

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();

connection = DriverManager.getConnection(connectionURL);
statement = connection.createStatement();
rs = statement.executeQuery(sSQLString);

while (rs.next()) { %>
<tr>
<td><tt><% out.print("FromDate"); %></tt></td>
<td><tt><% out.print("FromTime"); %></td>
</tr>
<% }
} catch (Exception ex) {
ex.printStackTrace();
} finally {
if (rs != null) rs.close();
if (statement != null) statement.close();
if (connection != null) connection.close();
} %>
</table>
</body>
</html>
Re: From MySQL to MSSQL Simon Hayes
3/31/2004 7:51:22 PM

[quoted text, click to view]

You should probably post this in microsoft.public.sqlserver.jdbc to get a
better answer. The only really obvious thing to check from the MSSQL side
would be that the Tracking table actually has data in it.

Simon

AddThis Social Bookmark Button