NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
cliveswan
Joined: 30 Nov 2009 Posts: 4
|
Posted: Thu Mar 11, 2010 11:53 am Post subject: Invalid Oracle URL specified |
|
|
Hi,
I have spent 2 days trying to get this working. Going round in circles.
I would really appreciate some assistance!!
Error: Invalid Oracle URL specified
I added the oracle thin driver
Services> Database> Driver> oracle.jdbc.driver.OracleDriver
<%@ page import="java.sql.*" %>
<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<html>
<body>
<%
Connection con = null;
Statement st;
ResultSet rs;
String sql = "";
String ProjectID = "";
sql = "SELECT * FROM Project";
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin@localhost:1521:orcl","test","test");
st = con.createStatement();
rs = st.executeQuery(sql);
%>
<table border=2>
<%
while(rs.next())
{
%> <tr>
<td><%=rs.getString("ProjID")%></td>
<td><%=rs.getString("SubID")%></td>
<td><%=rs.getString("AsID")%></td>
<td><%=rs.getString("Name")%></td>
</tr>
<% } %>
</table>
<%
rs.close();
con.close();
}
catch(Exception ex)
{
out.print(ex.getMessage());
}
%>
</body>
</html> |
|
| Back to top |
|
 |
cliveswan
Joined: 30 Nov 2009 Posts: 4
|
Posted: Thu Mar 11, 2010 2:06 pm Post subject: |
|
|
Hi
Eventually noticed it was missing a :
con = DriverManager.getConnection("jdbc:oracle:thin@localhost:1521:orcl","test","test");
Should be
("jdbc:oracle:thin:@localhost:1521:orcl","test","test"); |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|