Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
00923229
Commit
00923229
authored
Mar 21, 2002
by
Dave Cramer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Part of Anders Bengtsson's patch to clean up Connection.java
parent
d96c29ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
src/interfaces/jdbc/org/postgresql/core/StartupPacket.java
src/interfaces/jdbc/org/postgresql/core/StartupPacket.java
+43
-0
No files found.
src/interfaces/jdbc/org/postgresql/core/StartupPacket.java
0 → 100644
View file @
00923229
package
org.postgresql.core
;
import
org.postgresql.PG_Stream
;
import
java.io.IOException
;
/**
* Sent to the backend to initialize a newly created connection.
*
* $Id: StartupPacket.java,v 1.1 2002/03/21 02:40:03 davec Exp $
*/
public
class
StartupPacket
{
private
static
final
int
SM_DATABASE
=
64
;
private
static
final
int
SM_USER
=
32
;
private
static
final
int
SM_OPTIONS
=
64
;
private
static
final
int
SM_UNUSED
=
64
;
private
static
final
int
SM_TTY
=
64
;
private
int
protocolMajor
;
private
int
protocolMinor
;
private
String
user
;
private
String
database
;
public
StartupPacket
(
int
protocolMajor
,
int
protocolMinor
,
String
user
,
String
database
)
{
this
.
protocolMajor
=
protocolMajor
;
this
.
protocolMinor
=
protocolMinor
;
this
.
user
=
user
;
this
.
database
=
database
;
}
public
void
writeTo
(
PG_Stream
stream
)
throws
IOException
{
stream
.
SendInteger
(
4
+
4
+
SM_DATABASE
+
SM_USER
+
SM_OPTIONS
+
SM_UNUSED
+
SM_TTY
,
4
);
stream
.
SendInteger
(
protocolMajor
,
2
);
stream
.
SendInteger
(
protocolMinor
,
2
);
stream
.
Send
(
database
.
getBytes
(),
SM_DATABASE
);
// This last send includes the unused fields
stream
.
Send
(
user
.
getBytes
(),
SM_USER
+
SM_OPTIONS
+
SM_UNUSED
+
SM_TTY
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment