virker under Windows men ikke under Linux
Hej,Jeg har et problem med at få noget kode til at virke under Linux. Det som undre mig er at det virker fint under Windows. For at få fejlen skal man logge ind (test, 12345abc) og vælge en bane.
Windows: http://web-oasen.dk:8080/golf/
Linux : http://web-oasen.dk/golf/
Som det fremgår smider den er SQL exception under linux, men hvorfor?
package framework;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.sql.*;
import util.*;
public class Mboks1
{
public String visMboks1(int b, String navn)
{
StringBuffer buffer = new StringBuffer();
Databaseforbindelsemysqlprepared d = new Databaseforbindelsemysqlprepared("jdbc:mysql://URL/DB?user=USER&password=PASS", "org.gjt.mm.mysql.Driver");
if (b==1)
{
buffer.append("<table style=\"width:140px;border:ridge;border-width:thin;text-align:center;\">\n");
buffer.append("<tr><td>\n");
buffer.append("Login");
buffer.append("</td></tr>\n");
buffer.append("<tr><td>\n");
buffer.append("<form method=\"post\" name=\"loginform\" action=\"./\">\n");
buffer.append("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n");
buffer.append("<tr>\n");
buffer.append("<tr><td style=\"width:50%;\">User</td><td><input type=\"text\" name=\"user\" value=\"\" size=\"8\" class=\"inputf\"></td></tr>\n");
buffer.append("<tr><td style=\"width:50%;\">Pass</td><td><input type=\"password\" name=\"pass\" value=\"\" size=\"8\" class=\"inputf\"></td></tr>\n");
buffer.append("<input type=\"hidden\" name=\"start\" value=\"start\">\n");
buffer.append("<tr style=\"height:30px\"><td colspan=\"2\"><input type=\"submit\" value=\"Login\" class=\"knap\"><button class=\"knap\" onclick=\"java script:openwin('./index/ny_bruger_form.html', 'NY', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,height=250,width=400,top=145,left=175,screenY=150,screenX=100');\">Ny bruger</button></td></tr>\n");
buffer.append("</form></table>\n");
buffer.append("</td></tr>\n");
buffer.append("</table>\n");
buffer.append("<br>\n");
buffer.append("<form name=\"baner\" method=\"post\" action=\"./\">\n");
buffer.append("<select name=\"baner\" onchange=\"document.baner.submit();\">\n");
try
{
Vector vi0 = new Vector();
ResultSet rs = d.select("SELECT ID,navn FROM baner", vi0);
buffer.append("<option value=\"1\">Vælg bane\n");
while(rs.next())
{
String ID = rs.getString("ID");
String banenavn = rs.getString("navn");
buffer.append("<option value="+ID+">"+banenavn+"\n");
}
buffer.append("</select>\n");
buffer.append("</form>\n");
} catch (SQLException s) {
buffer.append("<h3>SQL fejl: " + s.toString() + " "
+ s.getErrorCode() + " " + s.getSQLState() + "</h3>");
}
buffer.append("<button class=\"knap\" onclick=\"java script:openwin('./index/ny_bruger_form.html', 'NY');\">Kalender</button>\n");
buffer.append("<br>\n");
buffer.append("<button class=\"knap\" onclick=\"java script:openwin('./index/ny_bruger_form.html', 'NY');\">Baner</button>\n");
buffer.append("<br>\n");
buffer.append("<button class=\"knap\" onclick=\"java script:openwin('./index/ny_bruger_form.html', 'NY');\">Links</button>\n");
}
else
{
buffer.append("Velkommen");
buffer.append("<br>");
buffer.append(navn);
buffer.append("<form name=\"baner\" method=\"post\" action=\"./\">\n");
buffer.append("<select name=\"baner\" onchange=\"document.baner.submit();\">\n");
try
{
Vector vi0 = new Vector();
ResultSet rs = d.select("SELECT ID,navn FROM baner", vi0);
buffer.append("<option value=\"1\">Vælg bane\n");
while(rs.next())
{
String ID = rs.getString("ID");
String banenavn = rs.getString("navn");
buffer.append("<option value="+ID+">"+banenavn+"\n");
}
buffer.append("</select>\n");
buffer.append("</form>\n");
} catch (SQLException s) {
buffer.append("<h3>SQL fejl: " + s.toString() + " "
+ s.getErrorCode() + " " + s.getSQLState() + "</h3>");
}
buffer.append("<button class=\"knap\" onclick=\"java script:openwin('./index/ny_bruger_form.html', 'NY');\">login Kalender</button>\n");
buffer.append("<br>\n");
buffer.append("<button class=\"knap\" onclick=\"java script:openwin('./index/ny_bruger_form.html', 'NY');\">Login Baner</button>\n");
buffer.append("<br>\n");
buffer.append("<button class=\"knap\" onclick=\"java script:openwin('./index/ny_bruger_form.html', 'NY');\">Login Links</button>\n");
}
return buffer.toString();
}
}