payess
asked on
No matter how hard i try, can't get a jdbc connection.
Hello. Please, if you could help me??!!
- language :::> java
- IDE :::> sun1studio
- OS :::> Win98
- jdk :::> 1.4
- Database :::> MSSQLServer (local)
- Accessing to a public db.
- Server :::> Tomcat 4.0 (internal)
- driver :::> com.microsoft.jdbc.sqlserv
- driver location :::> C:\s1studio\ce\lib\ext
- url (format) used:::> jdbc:microsoft:sqlserver:/
- c\Autoexec.bat :::> PATH C:\Novell\Client32;%PATH%;
set ANT_HOME=C:\ant
set JAVA_HOME=C:\j2sdk
Set NWLANGUAGE=ENGLISH
set PATH=%PATH%;%ANT_HOME%\bin
set CLASSPATH=.C:\Mis documentos\Lluis\struts\Pr
\lib\mssqlserver.jar
- App. Code:::> public class Connexio extends Object implements java.io.Serializable {
private static final String PROP_SAMPLE_PROPERTY = "SampleProperty";
private String sampleProperty;
private PropertyChangeSupport propertySupport;
private Connection conn;
private Vector dades;
public Connexio() throws ConnexioException{
propertySupport = new PropertyChangeSupport( this );
this.dades = Gestor.dades;
String driver = (String)dades.elementAt(0)
String uri = (String)dades.elementAt(1)
String user = (String)dades.elementAt(2)
String psw = (String)dades.elementAt(3)
try{
establirConnexio(driver, uri, user, psw);
}
catch(ConnexioException cE){
throw new ConnexioException (cE.getMessage());
}
}
public final void establirConnexio(String driver, String uri, String user, String password)throws ConnexioException{
if (conn != null){
}
else{
try
{
Class.forName(driver);
conn = DriverManager.getConnectio
}
catch(ClassNotFoundExcepti
{
throw new ConnexioException ("No es troba el Driver d'accés per a la BD demanada: " + c.getCause() + " ::: " + c.getLocalizedMessage());
}
catch(SQLException s)
{
throw new ConnexioException ("Error de connexió amb la BD");
}
}
}
- Error message :::> "SQLServer Driver ([Microsoft][SQLServer 2000 Driver for JDBC] Unhandled token type : Unknown token : 0x20)"
Generally i cannot get thru a connection. Don't think is a code problem. Basically, becasue i've done it hundreds of times. But the sun1studio IDE it's a new tool to me, and besides, i'm not very good at installing and configurating, only at programing, if so. So there you go, likely it is to be a configuration/install problem rather than a code problem. Still, at this point i only dare to say that i know nothing, so if you could help me out. I'm really having a mare and expecting it, any moment, to turn out to be a very silly thing.
Thanks in advanced!!
PS: You may excuse my english, i'm a catalan.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hit the nail!!
ASKER