Server: Rollingstonesand I get connected! WHO-HOOO! I can execute SQL and see the tables that I created using BAT files!
Login: mick
Password: jaggar
Client: Rollingstones
But when I try to compile and execute this JAVA code
import java.sql.DriverManager;I get this:
import java.sql.Connection;
import java.lang.ClassNotFoundException;
import java.sql.SQLException;
public class SybaseTry
{
public static void main( String args[] )
{
System.out.println("Starting!");
String driver="com.sybase.jdbc2.jdbc.SybDriver";
String dsn="jdbc:sybase:Tds:rollingstones:5000";
String dbUserName="mick";
String dbPassword="jaggar";
Connection con=null;
try
{
Class.forName(driver);
con = DriverManager.getConnection(dsn, dbUserName, dbPassword);
}
catch (ClassNotFoundException cnfx)
{
cnfx.printStackTrace();
System.exit(0);
}
catch (SQLException sqlx)
{
sqlx.printStackTrace();
System.exit(0);
}
System.out.println("Completed!");
}
}//END SybaseTry
G:\temp>d:\jdk1.2.2\bin\javac.exe SybaseTry.javaG:\temp>d:\jdk1.2.2\bin\java.exe SybaseTry
Starting!
java.sql.SQLException: JZ006: Caught IOException: java.net.ConnectException: Connection refused: no further
information
at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:423)
at com.sybase.jdbc2.tds.Tds.handleIOE(Tds.java:2780)
at com.sybase.jdbc2.tds.Tds.login(Tds.java:338)
at com.sybase.jdbc2.jdbc.SybConnection.tryLogin(SybConnection.java, Compiled Code)
at com.sybase.jdbc2.jdbc.SybConnection.regularConnect(SybConnection.java:190)
at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:169)
at com.sybase.jdbc2.jdbc.SybConnection.<init>(SybConnection.java:122)
at com.sybase.jdbc2.jdbc.SybDriver.connect(SybDriver.java:175)
at java.sql.DriverManager.getConnection(DriverManager.java:457)
at java.sql.DriverManager.getConnection(DriverManager.java:137)
at SybaseTry.main(SybaseTry.java:29)G:\temp>
Any suggestions?
--
Book'em, Dano.
What's the charge?
"MURDER ONE"
--
===============================================================================
Lance J. Andersen Email: lan...@sybase.com
Sybase Product Support Engineering Phone:(781) 564-6336
77 South Bedford Street Fax: (781) 564-7001
Burlington, MA 01803
The Dark Knight Returns!!! Let's Go Penguins!!!
===============================================================================
Lance Andersen wrote:
> Connection refused indicates the hostname and or port is incorrect.
>
> Dan Ward wrote:
> >
> --
> ===============================================================================
> Lance J. Andersen Email: lan...@sybase.com
> Sybase Product Support Engineering Phone:(781) 564-6336
> 77 South Bedford Street Fax: (781) 564-7001
> Burlington, MA 01803
>
> The Dark Knight Returns!!! Let's Go Penguins!!!
> ===============================================================================
--
Book'em, Dano.
What's the
charge?
"MURDER ONE"
--
Dan Ward - Software Engineer - XMLSolutions - (704) 849-2704
Dan Ward wrote:
> Since I can connect from SQL Advantage, the hostname is correct. I am damned if I
> can find any references to where the PORT number is set. I have tried all the PORT
> numbers used in the example programs that came with JConnect. What is the default
> port number from the INSTALL?
>
> Lance Andersen wrote:
>
> > Connection refused indicates the hostname and or port is incorrect.
> >
> > Dan Ward wrote:
> > >
> > --
> > ===============================================================================
> > Lance J. Andersen Email: lan...@sybase.com
> > Sybase Product Support Engineering Phone:(781) 564-6336
> > 77 South Bedford Street Fax: (781) 564-7001
> > Burlington, MA 01803
> >
> > The Dark Knight Returns!!! Let's Go Penguins!!!
> > ===============================================================================
>
> --
> Book'em, Dano.
> What's the
> charge?
> "MURDER ONE"
- Your ASE must have a tcp listener and if it does you can look at your
sql.ini to determine what port the server is listening on.
Dan Ward wrote:
>
> Since I can connect from SQL Advantage, the hostname is correct. I am damned if I
> can find any references to where the PORT number is set. I have tried all the PORT
> numbers used in the example programs that came with JConnect. What is the default
> port number from the INSTALL?
>
> Lance Andersen wrote:
>
> > Connection refused indicates the hostname and or port is incorrect.
> >
> > Dan Ward wrote:
> > >
> > --
> > ===============================================================================
> > Lance J. Andersen Email: lan...@sybase.com
> > Sybase Product Support Engineering Phone:(781) 564-6336
> > 77 South Bedford Street Fax: (781) 564-7001
> > Burlington, MA 01803
> >
> > The Dark Knight Returns!!! Let's Go Penguins!!!
> > ===============================================================================
>
> --
> Book'em, Dano.
> What's the
> charge?
> "MURDER ONE"
> --
> Dan Ward - Software Engineer - XMLSolutions - (704) 849-2704
--
I am facing a problem related to servlet.
I have an applet which is making a database connection and
adding records to the table. the database is sql server 6.5 this
applet is running fine from a client site if i am running it
with appletviewer.
when i am emdeding this applet in a servlet and trying to run it
from IE5, it is not adding any records to the table. the servlet
is coming onto the client side IE5 but not updating the records
in the table.
the java web server 2.0 and the sql database server 6.5 are on
the same windows nt 4.0 server. i am using jdk1.2 and jsdk2.0
for development.
please let me know what could be the problem. do we have to
configure the database on the web server. if yes then please let
me know the process.
my email id is manas...@usa.net
thanks and regards,
manas dey.
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com