PleaseHelp on jsp and Mysql connectivity and a lot of exception errors
Hi,
I am Trying to connect a JSP page with Mysql database. I am having a lot of probelms. After having a lot of problems in connecting the JSp with Mysql. Intilally it was giving me the exception error that " NO appropriate driver was found. After modifying the URl it was fine. Now It is giving the Following errors.
servlet.ServletException: Communication link failure: java.io.IOException, underlying cause: Unexpected end of input stream ** BEGIN NESTED EXCEPTION ** java.io.IOException MESSAGE: Unexpected end of input stream
In a window before loading the Explorer page it is giving the following error that The port 8081 is already in use and i should expand to other ports. Noraml JSP Files which used to work before are also not working .
Internal Tomcat JWSDP is alos not working. If i try to start the server it says that port 8081 is already in USe . A java.net.connection exception is also occuring. The normal JSP files are also not working. What is Happening. I am also giving the code i have writted. PLease tellme why so many exception errors are occuring.
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:8081/mis_project", "root", " ");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("Select study_semester FROM Semester");
while(rs.next()) {
%>
<option value="<%= rs.getString("Study_Semester") %>">
</option>
<% }
if(rs!=null) rs.close();
if(stmt!=null) stmt.close();
if(con!=null) con.close();
I am trying to connect to Mysql and automatocally populate a field in a Form in later JSp pages i intend to record the data entered in these fields into other tables.
<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/myDB?user=username&password=mypass");
Statement stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY);
String cat = "";
try{
cat = request.getParameter("category");
}catch(NullPointerException npe){}
ResultSet rs = stmt.executeQuery("SELECT id,fullname FROM users WHERE category LIKE '%motor%' AND subcategory like '%"+cat+"%'");
%>
This piece gets a category parameter from a form post and uses it to search for a specific category in a database table. I think maybe u need to download JConnector from mysql site and unzip it to the classes folder of your WEB-INF in Tomcat server...... i hope this helps a bit
Similar Messages
-
JSP with MySQL connection in Tomcat6.0.20
Hi i'm using MySQL5.1, Tomcat6.0.20 in my project, There i'm not able to connect to the database. it's giving the error.
My program is :
<%@ page language="java" import="java.sql.*" %>
<%
String driver = "org.gjt.mm.mysql.Driver";
Class.forName(driver).newInstance();
try{
String url="jdbc:mysql://localhost/books?user=root@localhost&password=india123";
Connection con=DriverManager.getConnection(url);
Statement stmt=con.createStatement();
catch(Exception e){
System.out.println(e.getMessage());
if(request.getParameter("action") != null){
String bookname=request.getParameter("book_name");
String author=request.getParameter("author");
stmt.executeUpdate("insert into books_lib(book_name,author) values('"+bookname+"','"+author+"')");
ResultSet rst=stmt.executeQuery("select * from books_lib");
%>
<html>
<body>
<center>
<h2>Books List</h2>
<table border="1" cellspacing="0" cellpadding="0">
<tr>
<td><b>S.No</b></td>
<td><b>Book Name</b></td>
<td><b>Author</.b></td>
</tr>
<%
int no=1;
while(rst.next()){
%>
<tr>
<td><%=no%></td>
<td><%=rst.getString("book_name")%></td>
<td> <%=rst.getString("author")%> </td>
</tr>
<%
no++;
rst.close();
stmt.close();
con.close();
%>
</table>
</center>
</body>
</html>
<%}else{%>
<html>
<head>
<title>Book Entry FormDocument</title>
<script language="javascript">
function validate(objForm){
if(objForm.bookname.value.length==0){
alert("Please enter Book Name!");
objForm.bookname.focus();
return false;
if(objForm.author.value.length==0){
alert("Please enter Author name!");
objForm.author.focus();
return false;
return true;
</script>
</head>
<body>
<center>
<form action="BookEntryForm.jsp" method="post" name="entry" onSubmit="return validate(this)">
<input type="hidden" value="list" name="action">
<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td>
<table>
<tr>
<td colspan="2" align="center">
<h2>Book Entry Form</h2></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td>Book Name:</td>
<td><input name="bookname" type="text" size="50"></td>
</tr>
<tr>
<td>Author:</td><td><input name="author" type="text" size="50"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Submit"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</center>
</body>
</html>
<%}%>
The error page is:
HTTP Status 500
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 19 in the jsp file: /singleupload/BookEntryForm.jsp
stmt cannot be resolved
16: if(request.getParameter("action") != null){
17: String bookname=request.getParameter("book_name");
18: String author=request.getParameter("author");
19: stmt.executeUpdate("insert into books_lib(book_name,author) values('"+bookname+"','"+author+"')");
20: ResultSet rst=stmt.executeQuery("select * from books_lib");
21: %>
22: <html>
An error occurred at line: 20 in the jsp file: /singleupload/BookEntryForm.jsp
stmt cannot be resolved
17: String bookname=request.getParameter("book_name");
18: String author=request.getParameter("author");
19: stmt.executeUpdate("insert into books_lib(book_name,author) values('"+bookname+"','"+author+"')");
20: ResultSet rst=stmt.executeQuery("select * from books_lib");
21: %>
22: <html>
23: <body>
An error occurred at line: 45 in the jsp file: /singleupload/BookEntryForm.jsp
stmt cannot be resolved
42: no++;
43: }
44: rst.close();
45: stmt.close();
46: con.close();
47: %>
48: </table>
An error occurred at line: 46 in the jsp file: /singleupload/BookEntryForm.jsp
con cannot be resolved
43: }
44: rst.close();
45: stmt.close();
46: con.close();
47: %>
48: </table>
49: </center>
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Please help me?An error occurred at line: 20 in the jsp file: /singleupload/BookEntryForm.jsp stmt cannot be resolved
That means it can't see any variable declared called "stmt"
There isn't one at this point.
The stmt variable you have declared up above, is nested in curly braces - within your try/catch statement. As such it only has scope within those curly braces. If you want to use stmt outside of the try block, you need to declare stmt outside of it.
And yes, I echo Balusc's comments about scriptlet code in a jsp page.
A better solution would be to write a java class with a method that does the database query, and returns a List of objects.
Your JSP can then take that list of objects and display them on the page.
Its a bit more work, but makes the code much easier to write/maintain/test because you separate out the "data" and "view" layers. -
JSP and MySql Connectivity in Fedora core 4
Dear all,
We are developing software using JSP and MySql on Fedora Core 4 platform and are unable to find the connectivity for JSP and MySql. Can anybody help....Dear all,
We are developing software using JSP and MySql on Fedora Core 4 platform and are unable to find the connectivity for JSP and MySql. Can anybody help.... -
Unable to connect JSP and MySQL
Hi, I am new to this forum
I've started developing web pages using JSP
I've the problem connecting JSP and MySQL database. I've created the page that retrive records from mysql table. But the connection fail to access to database it gives me this error:
org.apache.jasper.JasperException: Exception in JSP: /retreive_book.jsp:15
The code is:
12: <%
13: //Class.forName("com.mysql.jdbc.Driver").newInstance();
14: Class.forName("org.gjt.mm.mysql.Driver");
15: connection = DriverManager.getConnection(connectionURL,"","");
16: statement = connection.createStatement();
17: rs = statement.executeQuery("SELECT * FROM books_detail");
18: %>
And the connectionURL parameter has this value:
String connectionURL = "jdbc:mysql://localhost:3306/books?username=;password=";
root cause msg is:
java.sql.SQLException: Invalid authorization specification: Access denied for user 'nobody'@'localhost' (using password: NO)
Please can anyone help me. It is 3 days now trying to do that but not succeded yetHi
Yes It is true that my MySQl installation its username is root. So how should put that in the url. Cause I did that but it didn.t work
String connectionURL= "jdbc:mysql://localhost:3306/books?username=root;password=";
If I write in that manner is it correct for root username or should I put a single quote
Thanks -
An error when using JSP to activate connection between Javabean and MySQL
I just input two paramenters in the input.htm, then click button 'submit' to
run output.jsp, then activate adder.getSum(); This function is to add two
number, save the sum to the MySQL database, and return the sum. I think the
java code and jsp file are no problem. A guess it's the problem relating to
the servlet engine trying to talk to the Javabean. Should I set some
envirenment or other? Please take a look. If necessary, I will attach my jsp
and java codes later.
The error is as below:
Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error)
that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException:
at org.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRuntimeLibrary.java:273)
root cause org.apache.jasper.JasperException:
at org.apache.jasper.runtime.JspRuntimeLibrary.convert(JspRuntimeLibrary.java:184)
I just selected some. Thanks,Yes, I'd be curious to see your code. In principle that should work.
-chicagoJava -
Writing Login.jsp and authenticating a user who have stored in MySql DB
Hi Friends,
My project requirement is: Need to write a login page must send the request to servlet is the user and password avail in mysql db, if yes servlet should forward the home page else error message. Tools i need to use is IDE=eclipse, Server = tomcat, database = MySql
Here is source:
pls tell me where i m wrong.
Login.jsp
<%@ page language="java" %>
<html>
<head>
<title>Login Page</title>
<script language = "Javascript">
function Validate(){
var user=document.frm.user
var pass=document.frm.pass
if ((user.value==null)||(user.value=="")){
alert("Please Enter user name")
user.focus()
return false
if ((pass.value==null)||(pass.value=="")){
alert("Please Enter password")
pass.focus()
return false
return true
</script>
</head>
<body>
<h1>Login
<br>
</h1>
<form name="frm" action="/LoginAuthentication" method="Post" onSubmit="return Validate()" >
Name:
<input type="text" name="user" value=""/><br>
Password:<input type="password" name="pass" value=""/><br>
<br>
<input type="submit" value="Login" />
<input type="reset" value="forgot Password" />
</form>
</body>
</html>
Servlet Code:
LoginAuthentication.java
import java.io.*;
import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.ServletContext;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.ArrayList;
public class LoginAuthentication extends HttpServlet{
private ServletConfig config;
public void init(ServletConfig config)
throws ServletException{
this.config=config;
//public void init() {
// Normally you would load the prices from a database.
//ServletContext ctx = getServletContext();
// RequestDispatcher dispatcher = ctx.getRequestDispatcher("/HomePage.jsp");
//dispatcher.forward(req, res);
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException,IOException{
PrintWriter out = response.getWriter();
String connectionURL = "jdbc:mysql://127.0.0.1/SRAT";
//String connectionURL = "jdbc:mysql://192.168.10.59/SRAT";
//127.0.0.1
//http://localhost:3306/mysql
Connection connection=null;
ResultSet rs;
String userName=new String("");
String passwrd=new String("");
response.setContentType("text/html");
try {
// Load the database driver
Class.forName("com.mysql.jdbc.Driver");
// Get a Connection to the database
connection = DriverManager.getConnection(connectionURL, "admin", "admin");
//Add the data into the database
String sql = "select user,password from login";
Statement s = connection.createStatement();
s.executeQuery (sql);
rs = s.getResultSet();
while (rs.next ()){
userName=rs.getString("user");
passwrd=rs.getString("password");
rs.close ();
s.close ();
}catch(Exception e){
System.out.println("Exception is ;"+e);
if(userName.equals(request.getParameter("user"))
&& passwrd.equals(request.getParameter("pass"))){
out.println("WELCOME "+userName);
else{
out.println("Please enter correct username and password");
out.println("<a href='Login.jsp'><br>Login again</a>");
Deployment Descriptor for TOMCAT
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>
SRAT</display-name>
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>LoginAuthentication</servlet-name>
<servlet-class>LoginAuthentication</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginAuthentication</servlet-name>
<url-pattern>/LoginAuthentication</url-pattern>
</servlet-mapping>
</web-app>
PLS HELP ME.
S. Udaya ChandrikaI too have used the same code but its giving the following error:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Wrapper cannot find servlet class Validation or a class it depends on
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Unknown Source)
root cause
java.lang.ClassNotFoundException: Validation
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Unknown Source)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
Apache Tomcat/6.0.18
Please some one help?? -
Weblogic8.1 and mysql connection failure, please help
Pardon me for repeating this topic. I have spent 2 days on this but still ended
up with failure.
The similar configuration works very well under wls7.0.
It should not be a problem of jdbc driver or its classpath setting, since the
system console say "successful..."
But when I try to access jsp and servlets, it always throws execeptions. All projects
run successfully under wls7.0 don't work.
Please give me some advice, thanks in advance.
The following is my connection pool setting found in config.xml:
<JDBCConnectionPool DriverName="com.mysql.jdbc.Driver"
Name="MySQLConnectionPool" Password="{3DES}aMsyd4ZSbSg="
Properties="user=root" Targets="cgServer" URL="jdbc:mysql://localhost/userdb"/>
<JDBCTxDataSource EnableTwoPhaseCommit="true"
JNDIName="MySQLDataSource" Name="MySQLDataSource"
PoolName="MySQLConnectionPool" Targets="cgServer"/>
The screen shot of the exceptions is as below:
<2003-8-21 ÏÂÎç17ʱ14·Ö08Ãë EST> <Notice> <WebLogicServer> <BEA-000355> <Thread
"ListenThread.Default" listening on port 7001, ip address *.*>
java.lang.NoClassDefFoundError: weblogic/jdbc/wrapper/PoolConnection
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
3)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
ClassLoader.java:476)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
Loader.java:181)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
Loader.java:223)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:217)
at weblogic.utils.classfile.utils.CodeGenerator.generateClass(CodeGenera
tor.java:71)
at weblogic.utils.wrapper.WrapperFactory.generateWrapperClass(WrapperFac
tory.java:331)
at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.
java:167)
at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactor
y.java:66)
at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:242)
at weblogic.jdbc.pool.Driver.connect(Driver.java:158)
at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:444)
at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
ce.java:298)
at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:431)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
<2003-8-21 ÏÂÎç17ʱ14·Ö42Ãë EST> <Error> <HTTP> <BEA-101017> <[ServletContext(id
=2960804,name=forum,context-path=/forum)] Root cause of ServletException.
java.sql.SQLException: Cannot obtain connection: driverURL = jdbc:weblogic:pool:
MySQLConnectionPool, props = {enableTwoPhaseCommit=false, jdbcTxDataSource=true,
connectionPoolID=MySQLConnectionPool, dataSourceName=MySQLDataSource}.
Nested Exception: java.lang.RuntimeException: Failed to Generate Wrapper Class
at weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.ja
va:141)
at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactor
y.java:73)
at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:242)
at weblogic.jdbc.pool.Driver.connect(Driver.java:158)
at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:444)
at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
ce.java:298)
at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:431)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
at weblogic.jdbc.jts.Driver.wrapAndThrowSQLException(Driver.java:395)
at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:448)
at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
ce.java:298)
at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:431)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>1. This assumes that you have downloaded the mysql database and configured it and started
it by running mysqld. In my case, I installed it in d:/mysql.
2. It also assumes that you have configured a user on the database.
I configured a user "test" with password "test" on the database "mysql" on "localhost" using
mysql --user=root mysql
grant all privileges on *.* to test@localhost identified by 'test' with grant option;
3. It assumes that you have downloaded the Connector/J zip file and pulled out the jar file.
In my case, I renamed it and copied it to d:/mysql/lib/jdbc.jar.
4. It is absolutely necessary that you put the jar file in your server classpath. It won't
work without doing that. Then I booted the server.
5. I used the WLS 8.1 console to configure the connection pool and associated data source.
In my case, they look like the following:
<JDBCConnectionPool DriverName="org.gjt.mm.mysql.Driver"
Name="mysql" Password="test"
Properties="user=test"
Targets="myserver"
TestTableName="SQL SELECT 1"
URL="jdbc:mysql://localhost:3306/mysql"/>
<JDBCTxDataSource
JNDIName="myDataSource"
Name="myDataSource"
PoolName="mysql"
Targets="myserver"/>
Note that the console uses the old class name for the driver. There is a new class name but
the old name still exists and we figured it would cover folks using the old and new classes.
6. I'll attach a client program that looks up the datasource associated with the connection pool,
gets a connection, and does some stuff with the connection.
The user/password combination must have security priviledges in WLS to reserve a connection
on the pool.
The code for this program is taken almost entirely from the WLS JDBC documentation.
This is all pretty standard stuff.
"Roland" <[email protected]> wrote in message news:[email protected]...
>
Pardon me for repeating this topic. I have spent 2 days on this but still ended
up with failure.
The similar configuration works very well under wls7.0.
It should not be a problem of jdbc driver or its classpath setting, since the
system console say "successful..."
But when I try to access jsp and servlets, it always throws execeptions. All projects
run successfully under wls7.0 don't work.
Please give me some advice, thanks in advance.
The following is my connection pool setting found in config.xml:
<JDBCConnectionPool DriverName="com.mysql.jdbc.Driver"
Name="MySQLConnectionPool" Password="{3DES}aMsyd4ZSbSg="
Properties="user=root" Targets="cgServer" URL="jdbc:mysql://localhost/userdb"/>
<JDBCTxDataSource EnableTwoPhaseCommit="true"
JNDIName="MySQLDataSource" Name="MySQLDataSource"
PoolName="MySQLConnectionPool" Targets="cgServer"/>
The screen shot of the exceptions is as below:
<2003-8-21 ÏÂÎç17ʱ14·Ö08Ãë EST> <Notice> <WebLogicServer> <BEA-000355> <Thread
"ListenThread.Default" listening on port 7001, ip address *.*>
java.lang.NoClassDefFoundError: weblogic/jdbc/wrapper/PoolConnection
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
3)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
ClassLoader.java:476)
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
Loader.java:181)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
Loader.java:223)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:217)
at weblogic.utils.classfile.utils.CodeGenerator.generateClass(CodeGenera
tor.java:71)
at weblogic.utils.wrapper.WrapperFactory.generateWrapperClass(WrapperFac
tory.java:331)
at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.
java:167)
at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactor
y.java:66)
at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:242)
at weblogic.jdbc.pool.Driver.connect(Driver.java:158)
at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:444)
at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
ce.java:298)
at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:431)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
<2003-8-21 ÏÂÎç17ʱ14·Ö42Ãë EST> <Error> <HTTP> <BEA-101017> <[ServletContext(id
=2960804,name=forum,context-path=/forum)] Root cause of ServletException.
java.sql.SQLException: Cannot obtain connection: driverURL = jdbc:weblogic:pool:
MySQLConnectionPool, props = {enableTwoPhaseCommit=false, jdbcTxDataSource=true,
connectionPoolID=MySQLConnectionPool, dataSourceName=MySQLDataSource}.
Nested Exception: java.lang.RuntimeException: Failed to Generate Wrapper Class
at weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.ja
va:141)
at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactor
y.java:73)
at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:242)
at weblogic.jdbc.pool.Driver.connect(Driver.java:158)
at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:444)
at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
ce.java:298)
at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:431)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
at weblogic.jdbc.jts.Driver.wrapAndThrowSQLException(Driver.java:395)
at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:448)
at weblogic.jdbc.jts.Driver.connect(Driver.java:138)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
ce.java:298)
at jsp_servlet.__testmysql._jspService(__testmysql.java:129)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:431)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>[mysql.java] -
Problems with JSP and MySql bean.
Hi,
I'm new to JSP and I'm having some problems with it. I'm trying to do a simple login where a java class (bean?) handles the SQL injektion. I have deployed the page on tomcat and it works fine, except that the sqlinjektion does basically nothing. I have installed the mysql driver. I think there is something wrong with the java class, or the way im calling it. It does not produce any error. But its like it would never actually process the java code, because ive tried to append things to error string to see what is going on, nothing happens. everything stay null, no exceptions are thrown. If I implement the code to JSP itself, it does load the driver and print exception that there is no connection to database (which is correct). What am I missing? Code follows:
the sqlhandler:
public abstract class SqlInjektor {
private static String Database = "*****";
private static String serverName = "localhost:3306";
private static String usrName="******";
private static String passw="******";
* @return Connection
public static Connection createConnection(String error){
Connection mySqlCon = null;
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
catch(Exception E){
PrintWriter out = response.getWriter();
out.println("lol");
String url = "jdbc:mysql://" + serverName + "/" + Database + "?user=" + usrName + "&password=" + passw;
try{
mySqlCon = DriverManager.getConnection(url);
catch (Exception E){
E.printStackTrace(System.out);
return mySqlCon;
* Metodi saa sy�tteen��n SQL komennon, jonka se suorittaa sek� palauttaa komennon tulokset.
* @param command
* @return ResultSet
public static ResultSet querySQL(String command,String error, Connection con){
ResultSet rs = null;
try{
Statement stmt = con.createStatement();
rs = stmt.executeQuery(command);
catch(Exception E){
E.printStackTrace(System.out);
return rs;
the jsp page:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page isErrorPage="false" %>
<%@ page import="java.sql.*" %>
<%@page import="ot3.User"%>
<%@page import="ot3.SqlInjektor"%>
<%@page import="Javax.servlet.jsp.*"%>
<!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=ISO-8859-1">
<title>vastaanotto</title>
</head>
<body>
<%! String id;
String password;
String error = new String("Error!\n");
User user;
%>
<% user = new User();
session.putValue("currentUser",user);
id = request.getParameter("authName");
password = request.getParameter("Password");
Connection conn=null;
ResultSet rs=null;
conn = SqlInjektor.createConnection(error);
if(conn!=null){
out.println("conn ok!");
rs = SqlInjektor.querySQL("SELECT * FROM user WHERE id='" + id +"' AND password='" + password+"' COLLATE latin1_bin;",error,conn);}
try {
if (rs!= null && rs.next()){
user.setID(rs.getInt("id"));
user.setName(rs.getString("name"));
user.setPassword(rs.getString("password"));
user.setClearance(rs.getInt("clearance"));
if(rs.getString("addedby")!=null)
user.setAdder(rs.getInt("addedby"));
if(rs.getString("lastmodifier")!=null)
user.setModifier(rs.getInt("lastmodifier"));
rs.close();%>
ONNISTU!
<%}
else {
out.println(error);
} catch (SQLException e) {
out.println(e.getMessage());
}%>
</body>
</html>Hi,
I'm new to JSP and I'm having some problems with it. I'm trying to do a simple login where a java class (bean?) handles the SQL injektion. I have deployed the page on tomcat and it works fine, except that the sqlinjektion does basically nothing. I have installed the mysql driver. I think there is something wrong with the java class, or the way im calling it. It does not produce any error. But its like it would never actually process the java code, because ive tried to append things to error string to see what is going on, nothing happens. everything stay null, no exceptions are thrown. If I implement the code to JSP itself, it does load the driver and print exception that there is no connection to database (which is correct). What am I missing? Code follows:
the sqlhandler:
public abstract class SqlInjektor {
private static String Database = "*****";
private static String serverName = "localhost:3306";
private static String usrName="******";
private static String passw="******";
* @return Connection
public static Connection createConnection(String error){
Connection mySqlCon = null;
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
catch(Exception E){
PrintWriter out = response.getWriter();
out.println("lol");
String url = "jdbc:mysql://" + serverName + "/" + Database + "?user=" + usrName + "&password=" + passw;
try{
mySqlCon = DriverManager.getConnection(url);
catch (Exception E){
E.printStackTrace(System.out);
return mySqlCon;
* Metodi saa sy�tteen��n SQL komennon, jonka se suorittaa sek� palauttaa komennon tulokset.
* @param command
* @return ResultSet
public static ResultSet querySQL(String command,String error, Connection con){
ResultSet rs = null;
try{
Statement stmt = con.createStatement();
rs = stmt.executeQuery(command);
catch(Exception E){
E.printStackTrace(System.out);
return rs;
the jsp page:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page isErrorPage="false" %>
<%@ page import="java.sql.*" %>
<%@page import="ot3.User"%>
<%@page import="ot3.SqlInjektor"%>
<%@page import="Javax.servlet.jsp.*"%>
<!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=ISO-8859-1">
<title>vastaanotto</title>
</head>
<body>
<%! String id;
String password;
String error = new String("Error!\n");
User user;
%>
<% user = new User();
session.putValue("currentUser",user);
id = request.getParameter("authName");
password = request.getParameter("Password");
Connection conn=null;
ResultSet rs=null;
conn = SqlInjektor.createConnection(error);
if(conn!=null){
out.println("conn ok!");
rs = SqlInjektor.querySQL("SELECT * FROM user WHERE id='" + id +"' AND password='" + password+"' COLLATE latin1_bin;",error,conn);}
try {
if (rs!= null && rs.next()){
user.setID(rs.getInt("id"));
user.setName(rs.getString("name"));
user.setPassword(rs.getString("password"));
user.setClearance(rs.getInt("clearance"));
if(rs.getString("addedby")!=null)
user.setAdder(rs.getInt("addedby"));
if(rs.getString("lastmodifier")!=null)
user.setModifier(rs.getInt("lastmodifier"));
rs.close();%>
ONNISTU!
<%}
else {
out.println(error);
} catch (SQLException e) {
out.println(e.getMessage());
}%>
</body>
</html> -
PHP and MySQL Connection problem
I am trying to make a PHP MySQL on a remote server connection in Dreamwesaver CS3.
When I enter the information (host, user, password, etc.) and hit TEST, I get the following error message.
"Access Denied. The file may not exist, or there could be a permission problem. Make sure you have proper authorization on the server and the server is properly configured."
I know the user, password, etc. work, as I can access the MySQL database with other software.
I checked with my host and they say there are no permission problems on their end.
I have checked the settings on the Test Server page in Site Setup and everything looks correct and works there.
I have not seen this particular problem described in other forum postings (although there are a LOT of postings on this topic!).
Any help would be appreciated.I thought my testing server was the remote server and is always on as far as I know. I don't know how to turn it on or off.
Is there some other testing server that I should be aware of?
Frank
Date: Wed, 3 Jun 2009 15:43:02 -0600
From: [email protected]
To: [email protected]
Subject: PHP and MySQL Connection problem
I know you are using remote, but is your testing server on? if not turn that on and see if that does it. it just happened to me working on remote server and could not get mysql conn to work, until I turn on my testing (developer server), then I was able to connect to mysql and the tables that I created in phpmyadmin remotly was downloaded.
> -
Hi guys Pls tell me a way to connect db4 database with jsp and which driver
hi guys
Pls tell me a way to connect db4 database with jsp and
also tell me which driver i have to use
also tell me how to connect with excel sheetstake a look at the follwing links. There, you'll find all what you need :
DB4:
http://www.oracle.com/database/berkeley-db/je/index.html
http://www.oracle.com/technology/products/berkeley-db/je/index.html
http://www.oracle.com/database/berkeley-db/db/index.html
http://www.oracle.com/database/docs/berkeley-db-je-datasheet.pdf
Excel:
http://64.18.163.122/rgagnon/javadetails/java-0516.html
Hope That Helps -
Auto mySQL connectivity(Username and Password)
Hey guys!
Good Day!
I have something to ask if possible to java and mySQL connectivity.
I have project that connects to mysql but im using this:
"+con1 = DriverManager.getConnection("jdbc:mysql://localhost/POS_Database","root", "12345");+"
Now, how to auto config the mysql connection not setting the username and password in the project? It configure whatever the settings of mySQL (username and password).you will have to have the user name and password someware. If not in the code. You casn put them in a file and read it in the code.
Another thing that you can do is to make every user account of your software a valid user in the database. So when the user logs in to software users user name and the password is what you have to use to connect to database. But that will create a bit of a administrative overhead and also it will make it deficult to use connection pooling. -
HI guys,
I have been facing another problem. The codings below. Worked well with my JSP and Access database.
Then I transfered my database to MySQL and it gives out syntax error in my SQL statement.
CODE1:
sql = "SELECT Week, SUM (Total_Inspected) AS ins, SUM (Total_Rejected) AS rej, SUM (Total_Accepted) AS acc, SUM (DPPM) AS dpp, SUM (Yield) AS yeel FROM Calc_Data WHERE MONTH(Inspect_Date) ="+bulann+" GROUP BY Week";
ResultSet rs = stm.executeQuery(sql);
CODE2:
String query = "SELECT ID, Model, Lot_No, Lot_Qty, Inspected_By, Reject_Desc, Area_Concerned, Location, Remark FROM OQA WHERE Customer = '"+customer+"' AND Inspect_Date =#"+tarikh+"#";
ResultSet rs = stmt.executeQuery(query);Whenever you have this type of problem, the easiest
solution is to take the sql and try running it
directly. For MySQL, you can either use the
command-line client, or there are a few graphical
clients that can handle it. Just type in the query,
run it, and let the database itself tell you what the
error is.
In any case, you probably won't find much useful
advice on a JSP forum, esp. since the problem has
absolutely nothing to do with JSP.Indeed - I agree with this. - MOD -
I tried to use this class in my jsp page to connect to the DB2 database, However, no data from the DB appears on the page and i get no errors whatsoever. Can anyone be kind enough to take a look? Thanks
package WH;
import java.sql.*;
import java.sql.Statement;
public class DbConnect1 {
private String dbUser = "XXX";
private String dbPasswd = "XXX";
private String dbDriver = "COM.ibm.db2.jdbc.app.DB2Driver";
private String dbURL = "jdbc:db2:http://xx.xx.xxx.xx:8080/invsys";
private Connection dbCon;
public DbConnect1(){}
public boolean connect() throws ClassNotFoundException,SQLException{
try
Class.forName(dbDriver);
System.out.println("Loaded the instantDB JDBC driver.");
dbCon = DriverManager.getConnection(dbURL, dbUser, dbPasswd);
System.out.println("Created and connected to database TimingTest");
return true;
catch (Throwable e)
e.printStackTrace();
System.out.println("FAIL LAHHHHHHHHHHHH");
return false;
public void close() throws SQLException{
dbCon.close();
//accepts the SQL query in the form of a string from the JSP file in which this bean is implemented
public ResultSet execSQL(String sql) throws SQLException{
System.out.println("haha");
//initiates the connection with the dbCon connection object
Statement s = dbCon.createStatement();
ResultSet r = s.executeQuery(sql);
return (r == null) ? null : r;
public int updateSQL(String sql) throws SQLException{
Statement s = dbCon.createStatement();
int r = s.executeUpdate(sql);
return (r == 0) ? 0 : r;Here is a copy of my JSP file.
<%@ page language='java' %>
<%@ page import="java.sql.*" %>
<jsp:useBean id="DbConnectBean1" scope="page" class="WH.DbConnect1" />
<%
//Get status
/*String message;
String status = request.getParameter("status").trim();
if (status == "duplicateEmail")
message="Please try again. An account with the same emaill address has already been created.";
else if (status == "deleteOk")
message="Delete successful.";
else
message="";*/
//Get Contacts
String name;
String email;
String extNo;
String phoneNo;
String remarks;
String SQLstmt;
SQLstmt = "Select * from CONTACT";
if (DbConnectBean1.connect()==true){
%>
<html>
<head>
<title>Display Contacts</title>
<script src="validation.js" language="Javascript"></script>
<script Language="JavaScript">
//Perform Validation
/* function checkForm() {
var alertString=checkChkBox(theForm.chkItem.value);
formSubmit(alertString);
</script>
</head>
<body bgcolor="#ffffff">
<form action="USRDelContact.jsp" name="theForm" onsubmit="return checkForm();">
</form>
<table>
<tr>
<td><input type="chkAll" id="chkAll"onclick="checkAll(document.theForm.chkItem)"/></td>
<td>Name</td>
<td>Extension No.</td>
<td>Mobile Phone No.</td>
<td>Email Address</td>
<td>Remarks</td>
<td> </td>
</tr>
<%
ResultSet r = DbConnectBean1.execSQL(SQLstmt);
while (r.next()){
%>
<tr>
<td><input type="checkbox" name="chkItem" id="chkItem" value="<%= r.getString("Email")%>"/></td>
<td><%= r.getString("Emp_Name")%></td>
<td><%= r.getString("Ext_No")%></td>
<td><%= r.getString("Cellphone")%></td>
<td><a href="mailto:<%= r.getString(Email")%">"><%= r.getString("Email")%></a></td>
<td><%= r.getString("Remarks")%></td>
<td><a href="USREditContact.jsp?email=<%= r.getString("Email")%>">Edit</a></td>
</tr>
<%
if (r.next()==false)
%>
<tr>
<td colspan="7">There are no records currently.</td>
</tr>
<% }
}//end if%>
<tr colspan="6">
<td>
<%//=message%> <input type="submit" name="btnDelete" value="Delete">
</td>
</tr>
</table>
</form>
</body>
</html>
</a> -
Jar file and remote mysql connect
I have a jar file that i want anyone run it.The problem is that the code makes a connection to a database (mysql) to my computer.How anyone can connect to my databse in my computer from another pc without the user have to had the java \ mysql connect or hte mysql.Only the java.I try with a jnlp file and the jar file stored in my computer.I have a host name and i have open the port 3306 for mysql and allow remote connections to mysql.Can you help me;;
ok i connect to database like this:
try {
String userName = "username";
String password = "password";
String url = "jdbc:mysql://HOSTNAME/bankloans";
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn = DriverManager.getConnection(url, userName, password);
} catch (Exception e) {
System.out.prinln(e);
}The JNPL file
<?xml version="1.0" encoding="Windows-1251"?>
<jnlp
spec="1.0+"
codebase="http://nasikas.ath.cx:8080/bankloans/"
href="BankLoans.jnlp">
<information>
<title>Bank Loans Programme</title>
<vendor>Softlets</vendor>
<description>Bank Loans Programme</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6+"/>
<jar href="BankLoans.jar" main="true"/>
<jar href="mysql-connector-java-5.1.0-bin.jar"/>
</resources>
<application-desc main-class="Go"/>
</jnlp>What is wrong;; -
MySQL connection and Arithmetic operation resulted in an overflow
Hi
I installed MySQL connector and created a user DSN. In SSIS, a data source connection using ADO Net Source created and I was able to run a simple select statement in preview. But when I run a test transferring data from MYSQL to SQL, I got the following
error.
Error: 0xC0047062 at Data Flow Task, ADO NET Source [59]: System.OverflowException: Arithmetic operation resulted in an overflow.
at System.Data.Odbc.SQLLEN.op_Implicit(SQLLEN value)
at System.Data.Odbc.OdbcDataReader.BuildMetaDataInfo()
at System.Data.Odbc.OdbcDataReader.GetSchemaTable()
at Microsoft.SqlServer.Dts.Pipeline.DataReaderSourceAdapter.PreExecute()
I tested by limiting only 100 records of a single column and it worked. when I changed it to 1000 limits, I get an error.
I am wondering if this has to do with the size of the records. What is going on here?This means you chose a too limiting datatype.
You need to enlarge the one in question, or use a different one that can accommodate greater values.
Arthur My Blog
Maybe you are looking for
-
Set default filename for file save dialog
Hi, I am using AxAcroPDF control to view pdf files in windows forms. Is there any option to set the default filename in the save dialog? Thanks for your help. Freedon
-
Error : Creating PO with reference to Contract"CALL_OFF_CREATED"
Hi Experts, I am working on Extended Classic Scenario, We have created the Contract document in SRM and it replicates to ECC system successfully. While converting the contract document into Purchase Order document in the SRM system we are facing this
-
Error time out to connect FTP server
Hi Experts, I am getting the error in receiver communication channel (FTP) as : An error occurred while connecting to the FTP server ''. The FTP server returned the following error message: 'com.sap.aii.adapter.file.ftp.FTPEx: The control connection
-
Friends, I am facing problem in migrating ep 5 content to ep 6. My first hurdle is how to define the ep 5 system in ep 6. I have tried several ways but i am ending with same error message <b>Export objects of type SYSTEM was unsuccessful, Reason Root
-
Spyware for iPhone... Does it exist.. Is an I phone safe from hacking